@import url("https://fonts.googleapis.com/css2?family=DM+Sans:wght@400;500;600;700&family=Space+Grotesk:wght@400;500;600;700&display=swap");
:root {
  color-scheme: dark;
  --bg: #080f15;
  --panel: #101b24;
  --line: #263642;
  --muted: #99abb9;
  --lime: #d2fa86;
  --cyan: #8ddcf8;
  font-family: "DM Sans", sans-serif;
  color: #edf4fa;
  background: var(--bg);
}
* {
  box-sizing: border-box;
}
body {
  margin: 0;
}
button,
input,
select {
  font: inherit;
}
button,
a,
select,
input {
  outline-offset: 4px;
}
button {
  cursor: pointer;
}
a {
  color: inherit;
  text-decoration: none;
}
header {
  height: 76px;
  padding: 0 30px;
  border-bottom: 1px solid var(--line);
  display: flex;
  align-items: center;
  gap: 30px;
}
.brand {
  display: flex;
  align-items: center;
  gap: 12px;
  font-family: "Space Grotesk", sans-serif;
  font-size: 21px;
  font-weight: 700;
  letter-spacing: 2px;
}
.mark {
  border: 1px solid #768b81;
  width: 34px;
  height: 38px;
  display: grid;
  place-items: center;
  transform: skewY(-7deg);
  color: var(--lime);
}
.brand small {
  font-size: 11px;
  letter-spacing: 2px;
  color: var(--muted);
}
.divider {
  color: #516371;
  font-weight: 400;
}
nav {
  display: flex;
  gap: 25px;
  margin-left: auto;
  font-size: 14px;
  color: #b6c3ce;
}
nav a:hover {
  color: var(--lime);
}
.network {
  font-size: 11px;
  letter-spacing: 1px;
  color: #b4c5b5;
  white-space: nowrap;
}
.network i,
.canvas-caption i {
  display: inline-block;
  width: 6px;
  height: 6px;
  border-radius: 50%;
  background: var(--lime);
  box-shadow: 0 0 12px #caff7666;
  margin-right: 7px;
}
main {
  max-width: 1800px;
  margin: auto;
  padding: 25px 26px 18px;
}
.heading {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 24px;
}
.eyebrow,
.panel-label {
  font-size: 10px;
  letter-spacing: 1.7px;
  color: var(--muted);
  font-weight: 600;
}
.eyebrow {
  margin: 0 0 8px;
}
h1 {
  font-family: "Space Grotesk", sans-serif;
  font-size: 38px;
  line-height: 1.05;
  letter-spacing: -1.6px;
  font-weight: 500;
  margin: 0;
}
h1 em {
  font-style: normal;
  color: var(--lime);
}
.heading-note {
  font-size: 14px;
  line-height: 1.65;
  text-align: right;
}
.heading-note span {
  color: var(--muted);
}
.workspace {
  display: grid;
  grid-template-columns: 190px minmax(0, 1fr) 278px;
  border: 1px solid var(--line);
  border-radius: 12px;
  overflow: hidden;
  background: var(--panel);
  min-height: 520px;
}
.library {
  padding: 20px 14px;
  background: linear-gradient(135deg, #13202b, #101820);
  border-right: 1px solid var(--line);
}
h2 {
  font-family: "Space Grotesk", sans-serif;
  font-size: 19px;
  font-weight: 500;
  margin: 14px 0 5px;
}
.hint {
  font-size: 12px;
  line-height: 1.55;
  color: var(--muted);
  margin: 0 0 16px;
}
.palette-item {
  width: 100%;
  display: flex;
  align-items: center;
  gap: 10px;
  text-align: left;
  background: #15212c;
  border: 1px solid #30414f;
  color: #edf4fa;
  padding: 11px 10px;
  border-radius: 7px;
  margin-bottom: 8px;
  font-size: 13px;
  transition:
    background 0.2s,
    border 0.2s;
}
.palette-item:hover {
  background: #213342;
  border-color: var(--color);
}
.palette-item .symbol {
  color: var(--color);
  font-size: 21px;
  width: 22px;
}
.palette-item small {
  margin-left: auto;
  color: #92a69e;
  font-size: 14px;
}
.library-foot {
  margin-top: 24px;
  border-top: 1px solid var(--line);
  padding-top: 17px;
}
.library-foot .spark {
  color: var(--lime);
  font-size: 27px;
  display: block;
  margin-bottom: 9px;
}
.library-foot b {
  font-weight: 500;
  font-size: 13px;
}
.library-foot p {
  font-size: 12px;
  color: var(--muted);
  line-height: 1.6;
}
.archive-link {
  font-size: 12px;
  color: #c7d9e6;
}
.canvas-panel {
  min-width: 0;
  position: relative;
  background:
    radial-gradient(ellipse at 48% 50%, #1a3540aa, transparent 57%), #0b151e;
  display: flex;
  flex-direction: column;
}
.canvas-toolbar {
  height: 56px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 0 17px;
  border-bottom: 1px solid #263d4944;
  background: #14212a88;
  gap: 8px;
}
.preset-label {
  font-size: 10px;
  letter-spacing: 1px;
  color: var(--muted);
  display: flex;
  align-items: center;
  gap: 10px;
}
.preset-label select {
  width: 168px;
  background: #1c2c37;
  color: #e9f3f9;
  border: 1px solid #37505e;
  border-radius: 5px;
  padding: 7px 9px;
  font-size: 12px;
  letter-spacing: 0;
}
.icon-button {
  background: transparent;
  border: 0;
  color: #adbdc9;
  font-size: 18px;
  white-space: nowrap;
}
.icon-button span {
  font-size: 12px;
}
.canvas-caption {
  display: flex;
  justify-content: space-between;
  padding: 17px 19px 0;
  font-size: 9px;
  letter-spacing: 1.4px;
  color: #8199aa;
}
.canvas-caption span:first-child {
  color: #c1e1ce;
}
#viewport {
  position: relative;
  flex: 1;
  min-height: 402px;
  overflow: hidden;
  background-image: radial-gradient(#89adbd22 1px, transparent 1px);
  background-size: 20px 20px;
}
#board {
  position: absolute;
  width: 900px;
  height: 640px;
  transform-origin: top left;
}
#wires {
  position: absolute;
  inset: 0;
  width: 900px;
  height: 640px;
  overflow: visible;
  pointer-events: none;
}
.wire {
  fill: none;
  stroke: var(--color);
  stroke-width: 1.7;
  opacity: 0.65;
}
.wire-halo {
  fill: none;
  stroke: var(--color);
  stroke-width: 7;
  opacity: 0.13;
  filter: url(#glow);
}
.flow {
  fill: none;
  stroke: var(--color);
  stroke-width: 3;
  stroke-dasharray: 3 24;
  animation: flow 2.6s linear infinite;
  opacity: 0.8;
}
.wire.off {
  stroke: #3a5262;
  stroke-dasharray: 3 7;
  opacity: 0.4;
}
#pendingWire {
  fill: none;
  stroke: var(--lime);
  stroke-width: 2;
  stroke-dasharray: 5 5;
}
.node {
  position: absolute;
  width: 190px;
  height: 92px;
  background: linear-gradient(120deg, #1e2d3c, #14222f);
  border: 1px solid #41596d;
  border-radius: 10px;
  box-shadow: 0 8px 22px #0005;
  color: #e7f2fa;
  transition:
    box-shadow 0.2s,
    border-color 0.2s;
  user-select: none;
}
.node.active {
  border-color: color-mix(in srgb, var(--color) 60%, #233343);
}
.node.selected {
  box-shadow:
    0 0 0 2px var(--color),
    0 0 32px color-mix(in srgb, var(--color) 12%, transparent);
}
.node.disconnected {
  opacity: 0.65;
}
.node header {
  height: 32px;
  border-bottom: 1px solid #47607444;
  padding: 0 11px;
  gap: 6px;
  font-size: 9px;
  letter-spacing: 1px;
  color: var(--color);
  cursor: grab;
  touch-action: none;
}
.node header:active {
  cursor: grabbing;
}
.node header .grip {
  margin-left: auto;
  color: #8197a8;
  font-size: 17px;
}
.node-body {
  width: 100%;
  display: block;
  text-align: left;
  background: none;
  border: 0;
  color: inherit;
  padding: 9px 12px;
}
.node-body b {
  display: block;
  font-family: "Space Grotesk", sans-serif;
  font-size: 17px;
  font-weight: 500;
}
.node-body small {
  display: block;
  font-size: 12px;
  color: #a7bdcd;
  margin-top: 3px;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
.port {
  position: absolute;
  left: -7px;
  top: 42px;
  width: 13px;
  height: 13px;
  border-radius: 50%;
  background: #0d1b25;
  border: 2px solid var(--color);
  padding: 0;
  touch-action: none;
  z-index: 2;
}
.active .port {
  background: var(--color);
  box-shadow: 0 0 13px color-mix(in srgb, var(--color) 40%, transparent);
}
.core {
  height: 159px;
  width: 214px;
  border: 1px solid #b7e78c99;
  background: radial-gradient(at 50% 30%, #b3f28622, transparent 80%), #142823;
  --color: #d2fa86;
}
.core .node-body {
  padding: 18px;
}
.core .node-body b {
  font-size: 24px;
  letter-spacing: -1px;
}
.core .node-body small {
  margin-top: 9px;
  color: #b1c5b5;
  font-size: 14px;
}
.core .core-footer {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin: 0 16px;
  font-size: 10px;
  letter-spacing: 1px;
  color: #cceda8;
}
.core .port {
  left: auto;
  right: -7px;
  top: 76px;
  width: 15px;
  height: 15px;
}
.core .input-port {
  left: -7px;
  right: auto;
  pointer-events: none;
}
.diagram-note {
  position: absolute;
  left: 27px;
  top: 486px;
  color: #536e7d;
  font-size: 10px;
  letter-spacing: 1px;
  line-height: 2;
}
.diagram-note b {
  color: #8da8b9;
  font-size: 14px;
  font-weight: 400;
  letter-spacing: 0;
}
.canvas-bottom {
  padding: 12px 17px;
  display: flex;
  justify-content: space-between;
  gap: 10px;
  border-top: 1px solid #263d4944;
  font-size: 10px;
  color: #8198a8;
}
.canvas-bottom span:last-child {
  font-size: 9px;
  white-space: nowrap;
  letter-spacing: 1px;
}
.inspector {
  padding: 20px 18px;
  border-left: 1px solid var(--line);
  background: #14202a;
  max-height: 650px;
  overflow: auto;
}
.inspector-heading {
  display: flex;
  align-items: center;
  gap: 10px;
  margin: 17px 0 12px;
}
.inspector-heading .symbol {
  font-size: 23px;
  color: var(--color);
}
.inspector h2 {
  margin: 0;
  font-size: 21px;
}
.inspector .description {
  font-size: 13px;
  color: #aabccc;
  line-height: 1.55;
  margin: 0 0 16px;
}
.field {
  display: block;
  font-size: 12px;
  color: #bacad5;
  margin: 0 0 13px;
}
.field input,
.field select {
  display: block;
  width: 100%;
  margin-top: 6px;
  padding: 9px 10px;
  border: 1px solid #3a4c5b;
  background: #0b1721;
  border-radius: 5px;
  color: #eff5fa;
  font-size: 14px;
  min-width: 0;
}
.field input:focus,
.field select:focus {
  outline: 1px solid var(--lime);
  border-color: var(--lime);
}
.field small {
  font-size: 11px;
  color: #8fa4b4;
  line-height: 1.5;
  display: block;
  margin-top: 5px;
}
.connection-switch {
  width: 100%;
  display: flex;
  justify-content: space-between;
  border: 1px solid #51765b;
  background: #233b2a;
  color: #d6eabf;
  padding: 10px;
  border-radius: 5px;
  margin-bottom: 18px;
  font-size: 12px;
}
.connection-switch[aria-pressed="false"] {
  background: #202a34;
  border-color: #455562;
  color: #adbdc7;
}
.rule-note {
  font-size: 11px;
  color: #8fa3b3;
  line-height: 1.6;
  border-top: 1px solid var(--line);
  padding-top: 13px;
}
.build-bar {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 18px;
  background: #14202a;
  border: 1px solid var(--line);
  border-radius: 9px;
  margin-top: 12px;
  padding: 15px 18px;
}
.build-status {
  display: flex;
  align-items: center;
  gap: 12px;
  min-width: 0;
}
.status-orb {
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background: #edb774;
  box-shadow: 0 0 15px #edb77440;
  flex-shrink: 0;
}
.status-orb.ready {
  background: var(--lime);
}
.build-status b {
  font-size: 14px;
  font-weight: 500;
}
.build-status p {
  font-size: 12px;
  color: #a6b9c6;
  margin: 4px 0 0;
  max-width: 500px;
}
.build-actions {
  display: flex;
  gap: 8px;
  flex-shrink: 0;
}
.primary,
.secondary {
  border-radius: 6px;
  padding: 11px 14px;
  font-size: 12px;
  font-weight: 600;
  white-space: nowrap;
}
.primary {
  background: var(--lime);
  border: 1px solid var(--lime);
  color: #182219;
  box-shadow: 0 0 22px #caff7610;
}
.primary span {
  margin-left: 12px;
  font-size: 16px;
}
.primary:hover {
  background: #e0ffab;
}
.secondary {
  border: 1px solid #405563;
  background: #1b2b37;
  color: #e3edf4;
}
.secondary:hover {
  background: #2a4051;
}
.sub-bar {
  display: flex;
  justify-content: space-between;
  gap: 20px;
  color: #7f95a6;
  font-size: 11px;
  padding: 13px 3px;
  line-height: 1.5;
}
#message {
  font-size: 13px;
  color: var(--lime);
  margin: 0 2px;
  line-height: 1.6;
}
#message:empty {
  display: none;
}
.export-strip {
  display: flex;
  align-items: center;
  gap: 30px;
  border-top: 1px solid #22323d;
  padding: 23px 3px;
  margin-top: 8px;
}
.export-strip b {
  font-family: "Space Grotesk", sans-serif;
  font-weight: 500;
  font-size: 16px;
}
.export-strip p {
  font-size: 12px;
  color: #92a8b8;
  margin: 6px 0 0;
}
.export-strip button {
  margin-left: auto;
}
#downloadLink a {
  color: var(--lime);
  font-size: 12px;
}
.node:focus-visible {
  outline: 2px solid #fff;
  outline-offset: 5px;
}
@keyframes flow {
  to {
    stroke-dashoffset: -54;
  }
}
@media (min-width: 1450px) {
  .workspace {
    grid-template-columns: 216px minmax(0, 1fr) 310px;
  }
  .library {
    padding: 24px 19px;
  }
  #viewport {
    min-height: 525px;
  }
  .palette-item {
    font-size: 14px;
    padding: 13px 12px;
  }
  .inspector {
    padding: 24px;
  }
  .field {
    font-size: 13px;
  }
  .canvas-caption {
    font-size: 11px;
  }
}
@media (max-width: 1100px) {
  .workspace {
    grid-template-columns: 155px minmax(0, 1fr) 248px;
  }
  main {
    padding: 22px 16px;
  }
  .library {
    padding: 18px 10px;
  }
  .palette-item {
    font-size: 12px;
    gap: 6px;
    padding: 10px 8px;
  }
  .network {
    display: none;
  }
  .build-actions {
    gap: 5px;
  }
  .primary,
  .secondary {
    padding: 10px;
  }
  .heading-note {
    font-size: 12px;
  }
  .canvas-bottom span:last-child {
    display: none;
  }
  .preset-label {
    font-size: 0;
  }
  .preset-label select {
    font-size: 12px;
  }
  #viewport {
    overflow: auto;
  }
  #board {
    transform: none !important;
  }
  .canvas-caption {
    font-size: 8px;
  }
  .canvas-panel {
    min-height: 730px;
  }
}
@media (max-width: 760px) {
  header {
    height: auto;
    min-height: 90px;
    padding: 15px 18px;
    flex-wrap: wrap;
    gap: 15px;
  }
  .brand {
    font-size: 18px;
  }
  .brand small {
    font-size: 10px;
  }
  nav {
    margin: 0;
    width: 100%;
    gap: 25px;
    font-size: 13px;
  }
  .heading {
    display: block;
    margin-bottom: 20px;
  }
  h1 {
    font-size: 34px;
  }
  .heading-note {
    text-align: left;
    margin-top: 12px;
    font-size: 12px;
  }
  .workspace {
    display: flex;
    flex-direction: column;
  }
  .library {
    padding: 15px;
    border-right: 0;
    border-bottom: 1px solid var(--line);
  }
  .library h2,
  .library .hint,
  .library-foot,
  .archive-link {
    display: none;
  }
  #palette {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 6px;
    margin-top: 12px;
  }
  .palette-item {
    margin: 0;
    padding: 9px 6px;
    font-size: 10px;
    gap: 3px;
  }
  .palette-item .symbol {
    font-size: 17px;
    width: 18px;
  }
  .palette-item small {
    font-size: 11px;
  }
  .canvas-panel {
    min-height: 570px;
  }
  .canvas-caption {
    font-size: 9px;
  }
  #viewport {
    height: 450px;
    min-height: 450px;
    flex: none;
    overflow: auto;
  }
  #board {
    position: relative;
    transform: scale(0.8) !important;
    transform-origin: 0 0;
    width: 900px;
    height: 640px;
    margin-right: -180px;
    margin-bottom: -128px;
  }
  .canvas-bottom {
    font-size: 10px;
  }
  .inspector {
    border-left: 0;
    border-top: 1px solid var(--line);
    max-height: none;
    padding: 20px;
  }
  .build-bar {
    display: block;
    padding: 16px;
  }
  .build-actions {
    margin-top: 16px;
    display: grid;
    grid-template-columns: 1fr 1fr;
  }
  .build-actions .primary {
    grid-column: span 2;
  }
  .sub-bar {
    display: block;
    font-size: 11px;
  }
  .sub-bar span {
    display: block;
    margin-bottom: 6px;
  }
  .export-strip {
    flex-wrap: wrap;
    gap: 15px;
  }
  .export-strip button {
    margin: 0;
  }
  .field input,
  .field select {
    font-size: 16px;
  }
  .panel-label {
    font-size: 10px;
  }
}
@media (prefers-reduced-motion: reduce) {
  *,
  *:before,
  *:after {
    animation: none !important;
    transition: none !important;
  }
}
