:root {
  color-scheme: dark;
  --bg: #0b0e0d;
  --panel: #111514;
  --panel2: #171c1a;
  --panel3: #1d2321;
  --line: rgba(233, 244, 237, 0.1);
  --line2: rgba(233, 244, 237, 0.18);
  --text: #edf2ed;
  --muted: #87918c;
  --dim: #626b67;
  --lime: #b8f36b;
  --lime2: #8ccc45;
  --blue: #72b7ff;
  --orange: #ff9c64;
  --pink: #ef81b5;
  --danger: #ff7770;
  --sans: "Manrope", sans-serif;
  --mono: "DM Mono", monospace;
}
* {
  box-sizing: border-box;
}
html,
body {
  margin: 0;
  min-width: 320px;
  min-height: 100%;
  overflow: hidden;
  background: var(--bg);
  color: var(--text);
  font-family: var(--sans);
  -webkit-font-smoothing: antialiased;
}
button,
input,
textarea,
select {
  font: inherit;
}
button {
  color: inherit;
}
button:focus-visible,
input:focus-visible,
textarea:focus-visible,
select:focus-visible {
  outline: 2px solid var(--lime);
  outline-offset: 2px;
}
.skip {
  position: fixed;
  z-index: 100;
  top: 8px;
  left: 8px;
  transform: translateY(-150%);
  padding: 8px 12px;
  background: var(--lime);
  color: #10150d;
  border-radius: 7px;
}
.skip:focus {
  transform: none;
}
header {
  height: 64px;
  display: grid;
  grid-template-columns: 255px 1fr auto;
  align-items: center;
  padding: 0 17px;
  border-bottom: 1px solid var(--line);
  background: #0d1110;
  position: relative;
  z-index: 20;
}
.brand {
  display: flex;
  align-items: center;
  gap: 9px;
  color: inherit;
  text-decoration: none;
}
.brand strong {
  font-size: 14px;
  letter-spacing: -0.04em;
}
.brand small {
  margin-left: 1px;
  padding: 3px 5px;
  border: 1px solid var(--line);
  border-radius: 4px;
  color: var(--dim);
  font: 7px var(--mono);
  text-transform: uppercase;
  letter-spacing: 0.08em;
}
.mark {
  width: 29px;
  height: 29px;
  display: grid;
  place-items: center;
  position: relative;
  border: 1px solid rgba(184, 243, 107, 0.3);
  border-radius: 9px;
  background: rgba(184, 243, 107, 0.08);
}
.mark i {
  position: absolute;
  width: 5px;
  height: 5px;
  border: 1.5px solid var(--lime);
  border-radius: 2px;
}
.mark i:first-child {
  transform: translate(-6px, -5px);
}
.mark i:nth-child(2) {
  transform: translate(6px, -5px);
}
.mark i:nth-child(3) {
  transform: translate(0, 6px);
}
.mark:before,
.mark:after {
  content: "";
  position: absolute;
  width: 9px;
  height: 1px;
  top: 14px;
  background: rgba(184, 243, 107, 0.7);
}
.mark:before {
  left: 6px;
  transform: rotate(45deg);
}
.mark:after {
  right: 6px;
  transform: rotate(-45deg);
}
.crumb {
  display: flex;
  justify-content: center;
  align-items: center;
  gap: 8px;
  color: var(--dim);
  font-size: 10px;
}
.crumb b {
  color: #39403d;
}
.crumb strong {
  max-width: 280px;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  color: #cbd1cc;
  font-weight: 600;
}
.crumb button {
  border: 0;
  background: none;
  color: var(--dim);
  cursor: pointer;
}
.header-actions {
  display: flex;
  align-items: center;
  gap: 7px;
}
.saved {
  display: flex;
  align-items: center;
  gap: 6px;
  margin-right: 5px;
  color: var(--dim);
  font: 8px var(--mono);
}
.saved i {
  width: 5px;
  height: 5px;
  border-radius: 50%;
  background: var(--lime);
}
.icon-btn,
.outline-btn,
.run-btn {
  height: 33px;
  border-radius: 8px;
  cursor: pointer;
  font-size: 9px;
}
.icon-btn {
  width: 33px;
  border: 1px solid var(--line);
  background: var(--panel);
}
.outline-btn {
  padding: 0 12px;
  border: 1px solid var(--line);
  background: var(--panel);
}
.run-btn {
  display: flex;
  align-items: center;
  gap: 7px;
  padding: 0 12px;
  border: 0;
  background: var(--lime);
  color: #11180c;
  font-weight: 700;
}
.run-btn:hover {
  background: #c7ff7f;
  transform: translateY(-1px);
}
.run-btn:disabled {
  opacity: 0.65;
  transform: none;
  cursor: wait;
}
.run-btn span {
  font-size: 7px;
}
.run-btn kbd {
  color: rgba(17, 24, 12, 0.65);
  border-color: rgba(17, 24, 12, 0.2);
  background: rgba(17, 24, 12, 0.08);
}
kbd {
  padding: 2px 4px;
  border: 1px solid var(--line2);
  border-radius: 4px;
  color: var(--dim);
  font: 7px var(--mono);
}
.studio {
  height: calc(100vh - 64px);
  display: grid;
  grid-template-columns: 235px minmax(500px, 1fr) 250px;
}
.library,
.inspector {
  min-width: 0;
  background: #0e1211;
  overflow-y: auto;
  scrollbar-width: thin;
  scrollbar-color: var(--line2) transparent;
}
.library {
  padding: 20px 14px;
  border-right: 1px solid var(--line);
}
.panel-title,
.inspector-head {
  display: flex;
  justify-content: space-between;
  align-items: start;
}
.panel-title p,
.inspector-head p,
.dialog-head p {
  margin: 0 0 4px;
  color: var(--dim);
  font: 7px var(--mono);
  letter-spacing: 0.14em;
}
.panel-title h1,
.inspector-head h2,
.dialog-head h2 {
  margin: 0;
  font-size: 15px;
  letter-spacing: -0.035em;
}
.panel-title button,
.inspector-head button {
  width: 25px;
  height: 25px;
  border: 1px solid var(--line);
  border-radius: 6px;
  background: var(--panel);
  color: var(--dim);
  cursor: pointer;
}
.search {
  height: 35px;
  display: flex;
  align-items: center;
  gap: 7px;
  margin: 18px 0 13px;
  padding: 0 9px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--panel);
  color: var(--dim);
}
.search:focus-within {
  border-color: rgba(184, 243, 107, 0.4);
}
.search input {
  min-width: 0;
  flex: 1;
  border: 0;
  outline: 0;
  background: none;
  color: var(--text);
  font-size: 9px;
}
.group {
  margin-bottom: 17px;
}
.group-head {
  display: flex;
  justify-content: space-between;
  margin: 0 3px 7px;
  color: var(--dim);
  font: 7px var(--mono);
  text-transform: uppercase;
  letter-spacing: 0.12em;
}
.group-head span:last-child {
  font-size: 6px;
}
.block {
  width: 100%;
  display: grid;
  grid-template-columns: 30px 1fr auto;
  align-items: center;
  gap: 9px;
  margin: 4px 0;
  padding: 8px;
  border: 1px solid transparent;
  border-radius: 9px;
  background: transparent;
  text-align: left;
  cursor: pointer;
}
.block:hover {
  border-color: var(--line);
  background: var(--panel);
}
.block-icon {
  width: 29px;
  height: 29px;
  display: grid;
  place-items: center;
  border-radius: 8px;
  background: color-mix(in srgb, var(--block-color) 12%, transparent);
  color: var(--block-color);
  font-size: 11px;
}
.block-copy strong {
  display: block;
  color: #cbd1cc;
  font-size: 9px;
  font-weight: 600;
}
.block-copy small {
  display: block;
  margin-top: 2px;
  color: var(--dim);
  font-size: 7px;
}
.block-add {
  opacity: 0;
  color: var(--lime);
  font-size: 14px;
}
.block:hover .block-add {
  opacity: 1;
}
.template-button {
  width: 100%;
  display: grid;
  grid-template-columns: 27px 1fr auto;
  align-items: center;
  gap: 8px;
  margin-top: 12px;
  padding: 11px;
  border: 1px solid rgba(184, 243, 107, 0.16);
  border-radius: 10px;
  background: linear-gradient(130deg, rgba(184, 243, 107, 0.07), transparent);
  text-align: left;
  cursor: pointer;
}
.template-button > span {
  display: grid;
  place-items: center;
  width: 27px;
  height: 27px;
  border-radius: 8px;
  background: rgba(184, 243, 107, 0.1);
  color: var(--lime);
}
.template-button strong {
  display: block;
  font-size: 8px;
}
.template-button small {
  display: block;
  margin-top: 3px;
  color: var(--dim);
  font-size: 6px;
}
.template-button b {
  color: var(--lime);
  font-weight: 400;
}
.library-note {
  display: flex;
  gap: 8px;
  margin-top: 19px;
  padding: 10px 4px;
  border-top: 1px solid var(--line);
}
.library-note i {
  flex: 0 0 auto;
  width: 5px;
  height: 5px;
  margin-top: 4px;
  border-radius: 50%;
  background: var(--lime);
}
.library-note p {
  margin: 0;
  color: var(--dim);
  font: 7px/1.6 var(--mono);
}
.library-note strong {
  color: #9ca49f;
  font-weight: 400;
}
.canvas-shell {
  min-width: 0;
  display: grid;
  grid-template-rows: 41px minmax(280px, 1fr) 130px;
  background: #0b0e0d;
}
.canvas-toolbar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 0 13px;
  border-bottom: 1px solid var(--line);
  background: #101412;
}
.mode-switch {
  display: flex;
  gap: 3px;
}
.mode-switch button {
  padding: 5px 8px;
  border: 0;
  border-radius: 6px;
  background: transparent;
  color: var(--dim);
  font-size: 8px;
  cursor: pointer;
}
.mode-switch button.active {
  background: var(--panel3);
  color: #dfe5df;
}
.mode-switch span {
  margin-left: 3px;
  color: var(--lime);
  font: 6px var(--mono);
}
.canvas-meta {
  display: flex;
  align-items: center;
  gap: 8px;
  color: var(--dim);
  font: 7px var(--mono);
}
.canvas-meta i {
  width: 3px;
  height: 3px;
  border-radius: 50%;
  background: #39413d;
}
.zoom-tools {
  display: flex;
  border: 1px solid var(--line);
  border-radius: 7px;
  overflow: hidden;
}
.zoom-tools button,
.zoom-tools span {
  width: 27px;
  height: 24px;
  display: grid;
  place-items: center;
  border: 0;
  border-right: 1px solid var(--line);
  background: var(--panel);
  color: var(--dim);
  font-size: 9px;
}
.zoom-tools button {
  cursor: pointer;
}
.zoom-tools button:hover {
  color: var(--text);
}
.zoom-tools span {
  width: 37px;
  font: 6px var(--mono);
}
.zoom-tools > *:last-child {
  border-right: 0;
}
.canvas {
  position: relative;
  overflow: hidden;
}
.grid {
  position: absolute;
  inset: 0;
  background-image: radial-gradient(
    rgba(232, 245, 237, 0.11) 0.7px,
    transparent 0.7px
  );
  background-size: 19px 19px;
  mask-image: linear-gradient(to right, black 60%, transparent);
}
#connections {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  pointer-events: none;
  overflow: visible;
}
.connection {
  fill: none;
  stroke: #47504b;
  stroke-width: 1.4;
}
.connection.live {
  stroke: var(--lime);
  filter: drop-shadow(0 0 4px rgba(184, 243, 107, 0.6));
  stroke-dasharray: 6 5;
  animation: dash 0.45s linear infinite;
}
@keyframes dash {
  to {
    stroke-dashoffset: -11;
  }
}
#nodes {
  position: absolute;
  inset: 0;
  transform-origin: 0 0;
}
.flow-node {
  position: absolute;
  width: 150px;
  min-height: 86px;
  padding: 10px;
  border: 1px solid var(--line2);
  border-radius: 11px;
  background: rgba(21, 26, 24, 0.96);
  box-shadow: 0 12px 30px rgba(0, 0, 0, 0.28);
  cursor: grab;
  user-select: none;
  touch-action: none;
}
.flow-node:hover,
.flow-node.selected {
  border-color: var(--node-color);
}
.flow-node.running {
  border-color: var(--lime);
  box-shadow:
    0 0 0 2px rgba(184, 243, 107, 0.1),
    0 12px 30px rgba(0, 0, 0, 0.3);
}
.flow-node:active {
  cursor: grabbing;
}
.node-head {
  display: flex;
  justify-content: space-between;
  align-items: center;
}
.node-head span {
  width: 25px;
  height: 25px;
  display: grid;
  place-items: center;
  border-radius: 7px;
  background: color-mix(in srgb, var(--node-color) 13%, transparent);
  color: var(--node-color);
  font-size: 10px;
}
.node-head i {
  width: 5px;
  height: 5px;
  border-radius: 50%;
  background: var(--node-color);
  opacity: 0.7;
}
.flow-node strong {
  display: block;
  margin-top: 9px;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  font-size: 9px;
}
.flow-node p {
  margin: 3px 0 0;
  overflow: hidden;
  color: var(--dim);
  text-overflow: ellipsis;
  white-space: nowrap;
  font: 6px var(--mono);
}
.port {
  position: absolute;
  top: 42px;
  width: 8px;
  height: 8px;
  border: 2px solid #65706a;
  border-radius: 50%;
  background: var(--panel);
}
.port.in {
  left: -5px;
}
.port.out {
  right: -5px;
}
.flow-node:first-child .port.in {
  display: none;
}
.canvas-hint {
  position: absolute;
  left: 15px;
  bottom: 14px;
  display: flex;
  align-items: center;
  gap: 7px;
  color: var(--dim);
  font: 7px var(--mono);
}
.canvas-hint span {
  width: 17px;
  height: 17px;
  display: grid;
  place-items: center;
  border: 1px solid var(--line);
  border-radius: 5px;
}
.minimap {
  position: absolute;
  right: 14px;
  bottom: 13px;
  width: 100px;
  height: 65px;
  border: 1px solid var(--line);
  border-radius: 7px;
  background: rgba(14, 18, 17, 0.88);
  overflow: hidden;
}
.minimap > span {
  position: absolute;
  left: 6px;
  bottom: 4px;
  color: #4e5752;
  font: 5px var(--mono);
  letter-spacing: 0.1em;
}
.mini-node {
  position: absolute;
  width: 13px;
  height: 7px;
  border: 1px solid var(--mini-color);
  border-radius: 2px;
  background: color-mix(in srgb, var(--mini-color) 12%, transparent);
}
.console {
  border-top: 1px solid var(--line);
  background: #0d1110;
  overflow: hidden;
}
.console-head {
  height: 34px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 0 13px;
  border-bottom: 1px solid var(--line);
}
.console-head > div {
  display: flex;
  align-items: center;
  gap: 7px;
}
.console-head i {
  width: 6px;
  height: 6px;
  border-radius: 50%;
  background: var(--lime);
}
.console-head strong {
  font-size: 8px;
}
.console-head span {
  padding-left: 8px;
  border-left: 1px solid var(--line);
  color: var(--dim);
  font: 6px var(--mono);
}
.console-head button {
  border: 0;
  background: none;
  color: var(--dim);
  font-size: 7px;
  cursor: pointer;
}
.logs {
  height: 96px;
  overflow-y: auto;
  padding: 9px 13px;
  font: 7px/1.65 var(--mono);
  scrollbar-width: thin;
}
.logs p {
  margin: 0 0 3px;
  color: #8b958f;
}
.logs .muted {
  color: #505954;
}
.logs time {
  color: #4d5651;
  margin-right: 10px;
}
.logs b {
  margin-right: 9px;
  font-weight: 400;
}
.logs b.ok {
  color: var(--lime);
}
.logs b.run {
  color: var(--blue);
}
.logs b.done {
  color: var(--orange);
}
.inspector {
  padding: 19px 14px;
  border-left: 1px solid var(--line);
}
.inspector-empty {
  height: 100%;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  text-align: center;
  padding: 20px;
}
.inspector-empty > span {
  width: 42px;
  height: 42px;
  display: grid;
  place-items: center;
  border: 1px dashed var(--line2);
  border-radius: 13px;
  color: var(--dim);
  font-size: 18px;
}
.inspector-empty h2 {
  margin: 14px 0 6px;
  font-size: 12px;
}
.inspector-empty p {
  max-width: 175px;
  margin: 0;
  color: var(--dim);
  font-size: 8px;
  line-height: 1.6;
}
.node-identity {
  display: flex;
  align-items: center;
  gap: 10px;
  margin: 18px 0;
  padding: 11px;
  border: 1px solid var(--line);
  border-radius: 10px;
  background: var(--panel);
}
.node-identity > span {
  width: 31px;
  height: 31px;
  display: grid;
  place-items: center;
  border-radius: 8px;
  background: rgba(184, 243, 107, 0.08);
  color: var(--lime);
}
.node-identity strong {
  display: block;
  font-size: 9px;
}
.node-identity small {
  display: block;
  margin-top: 3px;
  color: var(--dim);
  font: 6px var(--mono);
}
.inspector-content label {
  display: grid;
  gap: 6px;
  margin: 13px 0;
  color: #9ca49f;
  font-size: 7px;
}
.inspector-content input,
.inspector-content textarea,
.inspector-content select {
  width: 100%;
  border: 1px solid var(--line);
  border-radius: 8px;
  padding: 8px 9px;
  outline: 0;
  background: #0c100f;
  color: #dce2dc;
  font-size: 8px;
}
.inspector-content textarea {
  min-height: 55px;
  resize: vertical;
  line-height: 1.5;
}
.inspector-content .code {
  min-height: 69px;
  color: #a8db7e;
  font: 7px/1.5 var(--mono);
}
.range-label > span {
  display: flex;
  justify-content: space-between;
}
.range-label output {
  color: var(--lime);
  font: 7px var(--mono);
}
.range-label input {
  height: 3px;
  padding: 0;
  accent-color: var(--lime);
}
.inspector-actions {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 7px;
  margin-top: 18px;
}
.inspector-actions button {
  height: 31px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--panel);
  font-size: 8px;
  cursor: pointer;
}
.inspector-actions .danger {
  color: var(--danger);
}
.toasts {
  position: fixed;
  z-index: 80;
  right: 18px;
  bottom: 18px;
  display: grid;
  gap: 7px;
}
.toast {
  display: flex;
  align-items: center;
  gap: 8px;
  min-width: 220px;
  padding: 10px 12px;
  border: 1px solid var(--line2);
  border-radius: 9px;
  background: #18201b;
  box-shadow: 0 15px 40px #0008;
  font-size: 8px;
  animation: toastin 0.2s ease;
}
.toast:before {
  content: "";
  width: 6px;
  height: 6px;
  border-radius: 50%;
  background: var(--lime);
}
@keyframes toastin {
  from {
    opacity: 0;
    transform: translateY(7px);
  }
}
dialog {
  width: min(620px, calc(100vw - 30px));
  padding: 22px;
  border: 1px solid var(--line2);
  border-radius: 16px;
  background: #121715;
  color: var(--text);
  box-shadow: 0 35px 100px #000b;
}
dialog::backdrop {
  background: #050706bb;
  backdrop-filter: blur(7px);
}
.dialog-head {
  display: flex;
  justify-content: space-between;
}
.dialog-head button {
  border: 0;
  background: none;
  color: var(--dim);
  font-size: 22px;
  cursor: pointer;
}
.dialog-copy {
  margin: 8px 0 20px;
  color: var(--muted);
  font-size: 9px;
}
.recipes {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 9px;
}
.recipes button {
  padding: 10px;
  border: 1px solid var(--line);
  border-radius: 11px;
  background: var(--panel);
  text-align: left;
  cursor: pointer;
}
.recipes button:hover {
  border-color: rgba(184, 243, 107, 0.4);
}
.recipe-art {
  height: 66px;
  display: grid;
  place-items: center;
  margin-bottom: 10px;
  border-radius: 8px;
  font: 15px var(--mono);
  letter-spacing: 7px;
}
.recipe-art.lime {
  background: rgba(184, 243, 107, 0.08);
  color: var(--lime);
}
.recipe-art.blue {
  background: rgba(114, 183, 255, 0.08);
  color: var(--blue);
}
.recipe-art.orange {
  background: rgba(255, 156, 100, 0.08);
  color: var(--orange);
}
.recipes strong {
  display: block;
  font-size: 9px;
}
.recipes small {
  display: block;
  min-height: 28px;
  margin-top: 4px;
  color: var(--dim);
  font-size: 7px;
  line-height: 1.5;
}
.recipes b {
  color: var(--lime);
  font: 6px var(--mono);
}
@media (max-width: 1050px) {
  .studio {
    grid-template-columns: 210px minmax(480px, 1fr);
  }
  .inspector {
    position: fixed;
    z-index: 30;
    right: 0;
    top: 64px;
    bottom: 0;
    width: 270px;
    box-shadow: -20px 0 50px #0008;
    transform: translateX(100%);
    transition: transform 0.2s;
  }
  .inspector.open {
    transform: none;
  }
  .inspector-empty {
    display: none;
  }
  .inspector-content[hidden] {
    display: none;
  }
  .crumb {
    display: none;
  }
}
@media (max-width: 760px) {
  html,
  body {
    overflow: auto;
  }
  header {
    grid-template-columns: 1fr auto;
  }
  .saved,
  .icon-btn,
  .outline-btn {
    display: none;
  }
  .studio {
    height: auto;
    min-height: calc(100vh - 64px);
    display: block;
  }
  .library {
    border-right: 0;
    border-bottom: 1px solid var(--line);
  }
  .node-groups {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 6px;
  }
  .library-note {
    display: none;
  }
  .canvas-shell {
    height: 650px;
  }
  .canvas-toolbar {
    position: sticky;
    top: 0;
  }
  .recipes {
    grid-template-columns: 1fr;
  }
  .console {
    height: 130px;
  }
}
@media (prefers-reduced-motion: reduce) {
  * {
    animation-duration: 0.01ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: 0.01ms !important;
  }
}
