.canvas-shell {
  --c-bg: #191b24;
  --c-panel: #22242e;
  --c-border: #343641;
  --c-muted: #a3a4b7;
  --c-text: #e9e9f3;
  background: var(--c-bg);
  color: var(--c-text);
  border: 1px solid var(--c-border);
  border-radius: 14px;
  overflow: hidden;
  height: calc(100vh - 130px);
  min-height: 600px;
  display: flex;
  flex-direction: column;
  box-shadow: 0 12px 38px #1716290c;
}
.canvas-shell.fullscreen {
  position: fixed;
  inset: 0;
  z-index: 40;
  border-radius: 0;
  height: 100dvh;
  min-height: 0;
}
.canvas-shell button {
  font-size: 13px;
}
.canvas-shell button:disabled {
  cursor: not-allowed;
  opacity: 0.4;
}
.canvas-shell button:focus-visible {
  outline: 2px solid #b9a0ff;
  outline-offset: 2px;
}
.canvas-shell svg {
  flex-shrink: 0;
}
.canvas-toolbar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 16px 20px;
  gap: 15px;
  background: #23252f;
  border-bottom: 1px solid var(--c-border);
}
.canvas-title {
  display: flex;
  gap: 12px;
  align-items: center;
  min-width: 0;
}
.canvas-mark {
  width: 38px;
  height: 38px;
  border-radius: 10px;
  background: #a896e724;
  display: grid;
  place-items: center;
  color: #bda7fa;
}
.canvas-title > div:last-child {
  min-width: 0;
}
.canvas-title input {
  display: block;
  background: transparent;
  border: 0;
  border-radius: 4px;
  padding: 0;
  box-shadow: none;
  font-weight: 600;
  font-size: 15px;
  color: var(--c-text);
  width: 250px;
  max-width: 100%;
  text-overflow: ellipsis;
}
.canvas-title input:focus {
  box-shadow: 0 1px 0 #bca4ff;
}
.canvas-title #canvas-state {
  display: block;
  color: var(--c-muted);
  font-size: 11px;
  margin-top: 6px;
}
.canvas-top-actions {
  display: flex;
  align-items: center;
  gap: 7px;
  flex-shrink: 0;
}
.canvas-top-actions > button {
  border-radius: 7px;
  padding: 8px 11px;
  display: flex;
  align-items: center;
  gap: 7px;
  color: #cdccdc;
}
.canvas-top-actions > button:hover {
  background: #ffffff0b;
}
.canvas-top-actions svg {
  width: 16px;
  height: 16px;
}
.canvas-top-actions .canvas-run {
  background: #9d86ed;
  color: #181228;
  font-weight: 600;
  margin-left: 8px;
  padding: 10px 13px;
}
.canvas-top-actions .canvas-run:hover {
  background: #b39bf9;
}
.canvas-run small {
  font-size: 11px;
  border-left: 1px solid #30204740;
  padding-left: 9px;
}
.canvas-subbar {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 7px 15px;
  border-bottom: 1px solid var(--c-border);
  background: #20222c;
  gap: 8px;
}
.canvas-subbar > div {
  display: flex;
  align-items: center;
  gap: 4px;
}
.canvas-subbar button {
  font-size: 12px;
  color: #b4b4c6;
  padding: 7px 9px;
  border-radius: 5px;
  white-space: nowrap;
}
.canvas-subbar button:hover {
  background: #ffffff0a;
  color: white;
}
.canvas-subbar svg {
  width: 16px;
  height: 16px;
}
.canvas-divider {
  display: block;
  width: 1px;
  height: 14px;
  background: var(--c-border);
  margin: 0 8px;
}
.canvas-demo {
  font-size: 11px;
  color: #b4a0dc;
  background: #b09be415;
  border: 1px solid #b49bed25;
  padding: 4px 8px;
  border-radius: 5px;
  margin-right: 6px;
}
.canvas-workspace {
  display: flex;
  flex: 1;
  min-height: 0;
  position: relative;
}
.canvas-palette {
  width: 168px;
  flex-shrink: 0;
  background: #20222c;
  border-right: 1px solid var(--c-border);
  padding: 20px 11px;
  display: flex;
  flex-direction: column;
  z-index: 3;
}
.cp-label {
  font-size: 11px;
  letter-spacing: 1px;
  color: #838698;
  margin: 0 11px 15px;
}
.canvas-palette button {
  display: flex;
  align-items: center;
  gap: 9px;
  text-align: left;
  padding: 12px 10px;
  color: #c6c7d6;
  border: 1px solid transparent;
  border-radius: 8px;
  margin-bottom: 7px;
  font-size: 12px;
  white-space: nowrap;
}
.canvas-palette button:hover {
  background: #2d2e3b;
  border-color: #424153;
}
.canvas-palette button svg {
  width: 17px;
  height: 17px;
  color: var(--node-color);
}
.canvas-palette button small {
  font-size: 10px;
  color: #848597;
  margin-left: auto;
}
.cp-foot {
  margin-top: auto;
  font-size: 10px;
  color: #7c7f92;
  line-height: 1.9;
  padding: 16px 10px 5px;
}
.canvas-stage {
  flex: 1;
  min-width: 0;
  min-height: 0;
  overflow: hidden;
  position: relative;
  touch-action: none;
  outline: none;
  background-color: #191b24;
  background-image: radial-gradient(#444453 1px, transparent 1px);
  background-size: 24px 24px;
  cursor: default;
}
.canvas-stage.dragging,
.canvas-stage.panning {
  cursor: grabbing;
}
.canvas-stage.connecting .input-port {
  box-shadow: 0 0 0 5px #b9a0ff2a;
  animation: portpulse 1.5s infinite;
}
.canvas-stage.connecting .port {
  cursor: crosshair;
}
.canvas-world {
  position: absolute;
  left: 0;
  top: 0;
  transform-origin: 0 0;
  will-change: transform;
}
.canvas-edges {
  position: absolute;
  left: 0;
  top: 0;
  width: 1px;
  height: 1px;
  overflow: visible;
  pointer-events: none;
  stroke: none;
  fill: none;
}
.canvas-edge .edge-hit {
  stroke: transparent;
  stroke-width: 17;
  pointer-events: stroke;
  cursor: pointer;
}
.canvas-edge .edge-line {
  stroke: #8f7cbb;
  stroke-width: 2;
  pointer-events: none;
}
.canvas-edge.selected .edge-line {
  stroke: #d0baff;
  stroke-width: 3;
}
.canvas-node {
  width: 260px;
  position: absolute;
  background: #252733;
  border: 1px solid #3d3d4e;
  border-radius: 11px;
  box-shadow: 0 8px 25px #00000025;
  user-select: none;
}
.canvas-node.selected {
  border-color: #b19af3;
  box-shadow:
    0 0 0 2px #ad91ee28,
    0 8px 25px #00000025;
}
.cn-header {
  padding: 14px 13px;
  border-bottom: 1px solid #ffffff0a;
  cursor: grab;
  display: flex;
  justify-content: space-between;
  align-items: center;
  height: 47px;
  border-top: 2px solid var(--node-color);
  border-radius: 10px 10px 0 0;
}
.cn-header > span {
  display: flex;
  align-items: center;
  font-size: 12px;
  color: #deddeb;
  overflow: hidden;
  white-space: nowrap;
  text-overflow: ellipsis;
}
.cn-header svg {
  width: 16px;
  height: 16px;
  color: var(--node-color);
}
.cn-more {
  font-size: 11px !important;
  color: #a3a2b7;
  padding: 5px;
  letter-spacing: 1px;
  flex-shrink: 0;
}
.cn-body {
  padding: 14px;
  min-height: 130px;
}
.cn-text {
  font-size: 13px;
  color: #c6c2d9;
  line-height: 1.9;
  white-space: pre-wrap;
  overflow-wrap: anywhere;
  max-height: 220px;
  overflow: hidden;
}
.cn-note {
  color: #d1c9a9;
}
.note-node {
  background: #302f2b;
  border-color: #625942;
}
.note-node .cn-header {
  border-top-color: #c2aa72;
}
.cn-provider {
  display: flex;
  gap: 7px;
  align-items: center;
  font-size: 11px;
  color: #cfcae2;
  background: #ffffff04;
  border: 1px solid #ffffff0a;
  border-radius: 6px;
  padding: 9px;
}
.cn-provider svg {
  width: 14px;
  height: 14px;
  color: var(--node-color);
}
.cn-mode {
  font-size: 8px;
  color: #ab9cce;
  margin-left: auto;
}
.cn-prompt {
  background: #1e202a;
  border: 1px solid #383947;
  border-radius: 6px;
  padding: 11px;
  font-size: 12px;
  line-height: 1.8;
  color: #aaa5bf;
  min-height: 68px;
  white-space: pre-wrap;
  overflow-wrap: anywhere;
  max-height: 150px;
  overflow: hidden;
  margin: 10px 0;
}
.cn-settings {
  display: flex;
  justify-content: space-between;
  color: #9590aa;
  font-size: 10px;
  margin: 10px 0 0;
}
.cn-settings > span:first-child {
  background: #393442;
  padding: 3px 7px;
  border-radius: 4px;
}
.canvas-node > footer {
  font-size: 9px;
  color: #79788e;
  display: flex;
  justify-content: space-between;
  padding: 10px 14px;
  border-top: 1px solid #ffffff07;
}
.canvas-node > footer > span {
  letter-spacing: 1px;
  font-size: 8px;
}
.port {
  position: absolute;
  width: 12px;
  height: 12px;
  padding: 0 !important;
  border: 2px solid #b6a4dd;
  border-radius: 50%;
  top: 49px;
  background: #252733;
  z-index: 1;
}
.port:hover {
  background: #b7a0ec;
  transform: scale(1.25);
}
.input-port {
  left: -6px;
}
.output-port {
  right: -6px;
}
.cn-image {
  width: 100%;
  height: 155px;
  object-fit: contain;
  display: block;
  border-radius: 6px;
  background: #181a23;
}
.cn-placeholder {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 12px;
  text-align: center;
  border: 1px dashed #444456;
  border-radius: 7px;
  padding: 23px 10px;
  min-height: 150px;
  font-size: 12px;
  color: #a8a1bd;
}
.cn-placeholder svg {
  width: 32px;
  height: 32px;
  stroke-width: 1.3;
  color: #7d7499;
}
.cn-placeholder small {
  font-size: 10px;
  color: #77758a;
}
.result-placeholder {
  background: radial-gradient(ellipse at 50% 0%, #b798e713, transparent 80%);
}
.cn-status {
  font-size: 10px;
  display: flex;
  gap: 6px;
  align-items: center;
  color: #c4b2e4;
  margin-top: 12px;
  border-top: 1px solid #3a3746;
}
.cn-status.completed {
  color: #96c1af;
}
.cn-status svg {
  width: 12px;
  height: 12px;
}
.canvas-inspector {
  width: 255px;
  flex-shrink: 0;
  background: #22242e;
  border-left: 1px solid var(--c-border);
  z-index: 3;
  overflow-y: auto;
  scrollbar-width: thin;
  scrollbar-color: #454254 transparent;
}
.ci-top {
  padding: 17px 18px;
  border-bottom: 1px solid var(--c-border);
  font-size: 12px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  color: #c1becf;
}
.ci-top svg {
  width: 15px;
  height: 15px;
  color: #8e88a2;
}
.ci-content {
  padding: 20px 18px;
}
.ci-intro {
  width: 43px;
  height: 43px;
  border: 1px solid #615177;
  border-radius: 12px;
  display: grid;
  place-items: center;
  background: #a285d81c;
  color: #b8a0e5;
  margin: 15px 0 22px;
}
.ci-content h3 {
  font-size: 15px;
  font-weight: 500;
  margin: 0 0 12px;
}
.ci-content p {
  color: #a5a0b6;
  line-height: 1.9;
  font-size: 12px;
  margin: 10px 0 20px;
}
.ci-step {
  display: flex;
  gap: 12px;
  align-items: center;
  font-size: 11px;
  color: #b3adc3;
  margin: 20px 0;
}
.ci-step b {
  display: grid;
  place-items: center;
  font-size: 10px;
  border: 1px solid #4a405d;
  width: 23px;
  height: 23px;
  border-radius: 7px;
  color: #b49adf;
  font-weight: 400;
}
.ci-summary {
  border-top: 1px solid var(--c-border);
  margin-top: 26px;
  padding-top: 14px;
}
.ci-summary > span {
  display: flex;
  justify-content: space-between;
  font-size: 11px;
  color: #918b9f;
  margin: 14px 0;
}
.ci-summary b {
  font-weight: 500;
  color: #c6b9df;
}
.ci-notice {
  margin-top: 24px;
  padding: 12px;
  background: #a28ad50a;
  border: 1px solid #a28ad51a;
  color: #9384ac;
  font-size: 10px;
  line-height: 1.9;
  border-radius: 7px;
}
.ci-type {
  display: flex;
  align-items: center;
  gap: 8px;
  font-size: 12px;
  margin: 0 0 19px;
}
.ci-type svg {
  width: 18px;
  height: 18px;
}
.canvas-inspector label {
  font-size: 11px;
  color: #b4adc6;
  margin: 17px 0 9px;
}
.canvas-inspector input,
.canvas-inspector textarea,
.canvas-inspector select {
  border: 1px solid #41404e;
  background: #1c1e28;
  color: #d2cce2;
  font-size: 12px;
  border-radius: 6px;
  padding: 10px;
}
.canvas-inspector textarea {
  min-height: 160px;
  line-height: 1.9;
}
.canvas-inspector input:focus,
.canvas-inspector textarea:focus,
.canvas-inspector select:focus {
  border-color: #a28bd5;
  box-shadow: 0 0 0 2px #a28bd512;
}
.ci-upload {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 10px;
  border: 1px dashed #514861;
  padding: 20px 10px;
  border-radius: 7px;
  cursor: pointer;
}
.ci-upload small {
  font-size: 9px;
  color: #8f829f;
}
.ci-preview {
  width: 100%;
  height: 130px;
  object-fit: contain;
  margin-top: 9px;
  border-radius: 5px;
}
.ci-link {
  color: #c4aedf;
  font-size: 11px !important;
  padding: 7px 0;
}
.ci-model {
  padding: 10px 9px;
  border: 1px solid #41404e;
  border-radius: 6px;
  font-size: 11px;
  display: flex;
  align-items: center;
  gap: 6px;
  color: #bab0cd;
}
.ci-model svg {
  width: 14px;
  height: 14px;
}
.ci-model span {
  font-size: 8px;
  margin-left: auto;
  color: #a28fc0;
}
.ci-content .ci-small {
  font-size: 10px;
  color: #8f829f;
}
.ci-actions {
  display: flex;
  gap: 8px;
  margin-top: 24px;
}
.ci-actions button,
.ci-danger {
  border: 1px solid #554555;
  border-radius: 6px;
  font-size: 11px !important;
  color: #bf9dbb;
  padding: 9px 10px;
}
.ci-actions button:first-child {
  color: #b9accd;
  border-color: #454051;
}
.ci-result {
  background: #1c1e27;
  border: 1px solid #41374d;
  padding: 10px;
  border-radius: 6px;
  margin-top: 7px;
  max-height: 200px;
  overflow: auto;
}
.ci-result strong {
  font-size: 11px;
  color: #b9c7b8;
  font-weight: 500;
}
.ci-result p {
  font-size: 11px;
  white-space: pre-wrap;
  line-height: 1.8;
  margin: 8px 0;
  color: #a59aaf;
  overflow-wrap: anywhere;
}
.canvas-badge {
  position: absolute;
  left: 22px;
  top: 20px;
  font-size: 10px;
  letter-spacing: 1px;
  color: #87859b;
  display: flex;
  align-items: center;
  gap: 7px;
  pointer-events: none;
}
.canvas-badge > span {
  width: 5px;
  height: 5px;
  border-radius: 50%;
  background: #9787b6;
}
.canvas-badge small {
  font-size: 8px;
  color: #625f77;
  border-left: 1px solid #494150;
  margin-left: 4px;
  padding-left: 10px;
  letter-spacing: 1.5px;
}
.canvas-bottom {
  position: absolute;
  bottom: 18px;
  left: 18px;
  right: 18px;
  pointer-events: none;
  display: flex;
  flex-direction: column;
  gap: 9px;
  align-items: flex-start;
}
.canvas-controls {
  pointer-events: auto;
  background: #292a36e8;
  border: 1px solid #444251;
  border-radius: 8px;
  display: flex;
  align-items: center;
  padding: 4px;
  box-shadow: 0 4px 16px #00000020;
}
.canvas-controls button {
  height: 28px;
  width: 30px;
  display: grid;
  place-items: center;
  color: #c5bdd5;
  border-radius: 5px;
  font-size: 19px;
}
.canvas-controls button:hover {
  background: #ffffff0a;
}
.canvas-controls button svg {
  width: 14px;
  height: 14px;
}
.canvas-controls i {
  height: 15px;
  width: 1px;
  background: #4a4355;
  margin: 0 4px;
}
.canvas-controls span {
  font-size: 10px;
  color: #a69ab9;
  min-width: 36px;
  text-align: center;
}
.canvas-bottom > #canvas-hint {
  font-size: 9px;
  color: #77738b;
}
.canvas-empty {
  position: absolute;
  left: 50%;
  top: 42%;
  transform: translate(-50%, -50%);
  text-align: center;
  width: 90%;
  pointer-events: none;
}
.canvas-empty[hidden] {
  display: none;
}
.canvas-empty > div {
  color: #8e76af;
  margin-bottom: 20px;
}
.canvas-empty svg {
  width: 45px;
  height: 45px;
  stroke-width: 1;
}
.canvas-empty h2 {
  font-size: 16px;
  font-weight: 400;
  color: #b3a2c8;
}
.canvas-empty p {
  font-size: 12px;
  color: #82758f;
  line-height: 1.9;
}
.canvas-library {
  max-height: 420px;
  overflow: auto;
}
.canvas-library > button {
  display: flex;
  text-align: left;
  width: 100%;
  align-items: center;
  justify-content: space-between;
  border: 1px solid #eee8f5;
  border-radius: 8px;
  padding: 13px;
  margin: 9px 0;
  font-size: 12px;
}
.canvas-library > button:hover {
  background: #f8f5fd;
}
.canvas-library b {
  font-size: 13px;
  font-weight: 500;
  display: inline;
  margin-left: 8px;
}
.canvas-library small {
  display: block;
  color: #9c91a7;
  font-size: 11px;
  margin: 7px 0 0 30px;
}
.canvas-library > button > span:last-child {
  color: #9a86b4;
}
.sr-only {
  position: absolute;
  width: 1px;
  height: 1px;
  padding: 0;
  margin: -1px;
  overflow: hidden;
  clip: rect(0, 0, 0, 0);
  white-space: nowrap;
  border: 0;
}
#canvas-node-menu {
  display: none;
}
@keyframes portpulse {
  50% {
    box-shadow: 0 0 0 7px #b9a0ff10;
  }
}
@media (max-width: 1250px) {
  .canvas-palette {
    width: 61px;
    padding: 18px 7px;
  }
  .canvas-palette button {
    padding: 13px;
    justify-content: center;
  }
  .canvas-palette button span,
  .canvas-palette button small,
  .cp-label,
  .cp-foot {
    display: none;
  }
  .canvas-inspector {
    width: 225px;
  }
  .canvas-title input {
    width: 200px;
  }
  .canvas-top-actions > button {
    padding: 7px;
  }
}
@media (max-width: 1000px) {
  .canvas-inspector {
    display: none;
    position: absolute;
    right: 0;
    top: 0;
    bottom: 0;
    width: 255px;
    box-shadow: -12px 0 35px #00000030;
  }
  .canvas-inspector.open {
    display: block;
  }
  .canvas-top-actions > button:not(.canvas-run) > span {
    display: none;
  }
  .canvas-title input {
    width: 190px;
  }
  .canvas-toolbar {
    padding: 14px;
  }
  .canvas-run small {
    display: none;
  }
  .canvas-bottom > #canvas-hint {
    max-width: 250px;
    line-height: 1.7;
  }
  .canvas-subbar button {
    padding: 7px;
    font-size: 11px;
  }
  .canvas-demo {
    display: none;
  }
}
@media (max-width: 700px) {
  .canvas-shell {
    height: calc(100dvh - 245px);
    min-height: 570px;
    border-radius: 10px;
  }
  .canvas-shell.fullscreen {
    min-height: 0;
    height: 100dvh;
  }
  .canvas-title input {
    width: 165px;
    font-size: 13px;
  }
  .canvas-top-actions {
    gap: 1px;
  }
  .canvas-top-actions .canvas-run {
    margin-left: 4px;
    font-size: 11px;
    padding: 9px;
  }
  .canvas-top-actions .canvas-run svg {
    display: none;
  }
  .canvas-mark {
    display: none;
  }
  .canvas-title #canvas-state {
    font-size: 10px;
  }
  .canvas-subbar {
    padding: 7px 8px;
  }
  .canvas-subbar button {
    font-size: 10px;
    padding: 6px;
  }
  .canvas-divider {
    margin: 0 2px;
  }
  .canvas-palette {
    display: none;
    position: absolute;
    left: 0;
    top: 0;
    bottom: 0;
    width: 160px;
    box-shadow: 12px 0 35px #00000030;
  }
  .canvas-palette.open {
    display: flex;
  }
  .canvas-palette button {
    justify-content: flex-start;
    padding: 12px 9px;
  }
  .canvas-palette button span,
  .canvas-palette button small,
  .cp-label,
  .cp-foot {
    display: block;
  }
  #canvas-node-menu {
    display: block;
  }
.canvas-badge {
    font-size: 9px;
    left: 17px;
  }
  .canvas-badge small {
    display: none;
  }
  .canvas-toolbar {
    gap: 8px;
    padding: 12px;
  }
  .canvas-bottom {
    left: 12px;
    bottom: 14px;
  }
  .canvas-bottom > #canvas-hint {
    font-size: 8px;
    max-width: 250px;
  }
  .canvas-controls button {
    width: 25px;
  }
  .canvas-inspector.open {
    width: 240px;
  }
}
.canvas-shell.is-busy .canvas-workspace {
  pointer-events: none;
  opacity: 0.75;
}
.cn-generated {
  margin-top: 12px;
}
.canvas-inspector .result {
  background: #1a1b24;
  color: #bfb2d0;
  font-size: 11px;
  padding: 10px;
}
.canvas-inspector .task-media {
  border-color: #453a55;
  padding: 7px;
}
.canvas-inspector .task-media a {
  font-size: 11px;
}
.canvas-inspector .task-media img,
.canvas-inspector .task-media video {
  max-height: 170px;
}
.cn-status.failed {
  color: #dd9595;
}
.cn-status.needs_review {
  color: #dabb82;
}
