/* ============================================
   WORKFLOW BUILDER — Light theme (matches Finora)
   ============================================ */

body.builder {
  background: var(--finora-bg);
  height: 100vh;
  overflow: hidden;
}

body.builder .app {
  height: 100vh;
  min-height: 0;
  overflow: hidden;
}

body.builder .main {
  height: 100vh;
  min-height: 0;
  overflow: hidden;
}

body.builder .topbar,
body.builder .bld-bar {
  flex: 0 0 auto;
}

.builder-page {
  display: flex;
  flex-direction: column;
  flex: 1;
  min-height: 0;
  height: auto;
}

/* ===== TOOLBAR (under topbar) ===== */
.bld-bar {
  display: flex;
  align-items: center;
  gap: 14px;
  padding: 12px 24px;
  background: #fff;
  border-bottom: 1px solid var(--finora-border);
}
.bld-title-edit {
  display: flex; align-items: center; gap: 8px;
  padding: 8px 12px;
  background: var(--finora-bg);
  border: 1px solid var(--finora-border);
  border-radius: 10px;
  min-width: 280px;
}
.bld-title-edit input {
  background: none; border: none; outline: none;
  font-weight: 700;
  font-size: 14px;
  flex: 1;
  color: var(--finora-text);
}
.bld-title-edit svg { width: 14px; height: 14px; color: var(--finora-text-soft); }

.crumbs {
  display: flex; align-items: center; gap: 6px;
  color: var(--finora-text-soft);
  font-size: 13px;
}
.crumbs a { color: var(--finora-text-soft); }
.crumbs a:hover { color: var(--finora-text); }
.crumbs .sep { color: #CBD5E1; }

/* mode toggle (easy/expert) — same look as live tabs */
.mode-toggle {
  display: flex;
  background: #F1F5F9;
  border-radius: 10px;
  padding: 3px;
}
.mode-btn {
  padding: 7px 14px;
  font-size: 12px;
  font-weight: 700;
  color: var(--finora-text-soft);
  border-radius: 7px;
  cursor: pointer;
  display: inline-flex; align-items: center; gap: 6px;
  transition: background .12s, color .12s;
}
.mode-btn svg { width: 13px; height: 13px; }
.mode-btn:hover { color: var(--finora-text); }
.mode-btn.active {
  background: #fff;
  color: var(--finora-blue);
  box-shadow: 0 1px 2px rgba(15,23,42,.06);
}
.mode-btn.expert.active {
  color: #fff;
  background: linear-gradient(135deg, #8B5CF6, #EC4899);
  box-shadow: 0 4px 10px rgba(139,92,246,.30);
}

.bld-status {
  display: inline-flex; align-items: center; gap: 6px;
  padding: 5px 11px;
  background: #DCFCE7;
  color: #16A34A;
  font-size: 11px; font-weight: 700;
  border-radius: 999px;
}
.bld-status::before {
  content: ""; width: 7px; height: 7px;
  border-radius: 50%; background: #16A34A;
  box-shadow: 0 0 6px #16A34A;
  animation: pulse 2s ease-in-out infinite;
}
@keyframes pulse { 50% { opacity: .5; } }

.bld-actions { margin-left: auto; display: flex; align-items: center; gap: 8px; }

/* ===== BUILDER MAIN GRID ===== */
.bld-main {
  flex: 1;
  display: grid;
  grid-template-columns: 264px 1fr 340px;
  min-height: 0;
  overflow: hidden;
}
.bld-main.easy-mode { grid-template-columns: 240px 1fr 300px; }

/* ===== LIBRARY (LEFT) ===== */
.bld-lib {
  position: relative;
  background: #fff;
  border-right: 1px solid var(--finora-border);
  overflow-y: auto;
  overflow-x: hidden;
  padding: 16px 14px;
  display: flex; flex-direction: column;
  gap: 6px;
  min-height: 0;
  scrollbar-gutter: stable;
  overscroll-behavior: contain;
  -webkit-overflow-scrolling: touch;
}
.bld-lib::after {
  content: "";
  position: sticky;
  left: 0;
  right: 0;
  bottom: -16px;
  height: 28px;
  margin: 0 -14px -16px;
  background: linear-gradient(180deg, rgba(255,255,255,0), #fff 72%);
  pointer-events: none;
  z-index: 3;
}
.lib-search {
  position: sticky;
  top: 0;
  z-index: 5;
  display: flex; align-items: center; gap: 10px;
  padding: 9px 12px;
  background: var(--finora-bg);
  border: 1px solid var(--finora-border);
  border-radius: 10px;
  margin-bottom: 6px;
  box-shadow: 0 10px 20px rgba(255,255,255,.86);
}
.lib-search svg { width: 14px; height: 14px; color: var(--finora-text-soft); }
.lib-search input {
  flex: 1; background: none; border: none; outline: none;
  color: var(--finora-text); font-size: 13px;
}

.lib-group {
  margin-top: 12px;
}
.lib-group-h {
  display: flex; align-items: center; gap: 8px;
  font-size: 10px;
  text-transform: uppercase;
  letter-spacing: .08em;
  color: var(--finora-text-soft);
  padding: 0 4px 8px;
  font-weight: 700;
}
.lib-group-h .ic { width: 14px; height: 14px; }
.lib-group-h .line { flex: 1; height: 1px; background: var(--finora-border-soft); }

.lib-block {
  display: flex; align-items: center; gap: 10px;
  padding: 9px 11px;
  background: #fff;
  border: 1px solid var(--finora-border-soft);
  border-radius: 10px;
  cursor: grab;
  margin-bottom: 4px;
  transition: background .12s, border-color .12s, transform .1s;
}
.lib-block:hover {
  background: var(--finora-bg);
  border-color: var(--finora-border);
  transform: translateX(2px);
}
.lib-block:active { cursor: grabbing; }
.lib-block.dragging { opacity: .5; }
.lib-block .ico {
  width: 30px; height: 30px;
  border-radius: 8px;
  display: grid; place-items: center;
  flex: 0 0 30px;
}
.lib-block .ico svg { width: 14px; height: 14px; }
.lib-block .info { min-width: 0; flex: 1; }
.lib-block .name { font-size: 13px; font-weight: 600; }
.lib-block .desc { font-size: 11px; color: var(--finora-text-soft); margin-top: 1px; }
.lib-block .pro {
  font-size: 9px;
  padding: 2px 6px;
  border-radius: 4px;
  background: linear-gradient(135deg, #8B5CF6, #EC4899);
  color: white;
  font-weight: 700;
  letter-spacing: .04em;
  margin-left: auto;
  flex: 0 0 auto;
}

/* category colors (same palette as Finora cards) */
.lib-block.cat-trigger .ico { background:#EEF2FF; color:#3D63F5; }
.lib-block.cat-action  .ico { background:#F3E8FF; color:#8B5CF6; }
.lib-block.cat-check   .ico { background:#DCFCE7; color:#16A34A; }
.lib-block.cat-logic   .ico { background:#FEF3C7; color:#D97706; }
.lib-block.cat-mailbox .ico { background:#CFFAFE; color:#0891B2; }
.lib-block.cat-expert  .ico { background:#FCE7F3; color:#DB2777; }
.lib-block.cat-server  .ico { background:#CCFBF1; color:#0F766E; }

/* hide expert blocks in easy mode */
.bld-main.easy-mode .expert-only,
.bld-main.easy-mode .lib-group.expert-only {
  display: none !important;
}

/* ===== CANVAS (CENTER) ===== */
.bld-canvas-wrap {
  position: relative;
  overflow: hidden;
  background:
    radial-gradient(circle at center, rgba(61,99,245,.04) 0%, transparent 70%),
    var(--finora-bg);
}
.bld-canvas {
  position: absolute; inset: 0;
  background-image:
    radial-gradient(circle, rgba(15,23,42,.10) 1px, transparent 1px);
  background-size: 22px 22px;
  overflow: auto;
}
.bld-stage {
  position: relative;
  width: 1600px;
  height: 800px;
  min-width: 100%;
}

/* canvas toolbar */
.canvas-tools {
  position: absolute;
  top: 16px; left: 16px;
  display: flex; gap: 8px;
  z-index: 6;
}
.canvas-tool {
  width: 36px; height: 36px;
  border-radius: 10px;
  background: #fff;
  border: 1px solid var(--finora-border);
  display: grid; place-items: center;
  color: var(--finora-text-soft);
  cursor: pointer;
  box-shadow: 0 2px 6px rgba(15,23,42,.04);
}
.canvas-tool:hover { background: var(--finora-bg); color: var(--finora-text); }
.canvas-tool.active { background: var(--finora-blue); color: #fff; border-color: transparent; }
.canvas-tool svg { width: 16px; height: 16px; }

.canvas-zoom {
  position: absolute;
  bottom: 16px; left: 16px;
  display: flex; align-items: center; gap: 4px;
  padding: 5px;
  background: #fff;
  border: 1px solid var(--finora-border);
  border-radius: 10px;
  z-index: 6;
  box-shadow: 0 2px 6px rgba(15,23,42,.04);
}
.canvas-zoom button {
  width: 26px; height: 26px;
  border-radius: 7px;
  color: var(--finora-text-soft);
}
.canvas-zoom button:hover { background: var(--finora-border-soft); color: var(--finora-text); }
.canvas-zoom .val { padding: 0 6px; font-size: 12px; font-weight: 600; color: var(--finora-text-soft); }

/* empty hint */
.canvas-hint {
  position: absolute;
  left: 50%; top: 50%;
  transform: translate(-50%, -50%);
  text-align: center;
  color: var(--finora-text-soft);
  font-size: 13px;
  pointer-events: none;
  z-index: 1;
}
.canvas-hint .big {
  font-size: 16px;
  font-weight: 700;
  color: var(--finora-text);
  margin-bottom: 6px;
}
.canvas-hint svg { width: 32px; height: 32px; opacity: .5; margin-bottom: 12px; }

/* ===== NODES on canvas ===== */
.node {
  position: absolute;
  width: 230px;
  background: #fff;
  border: 1.5px solid var(--finora-border);
  border-radius: 14px;
  box-shadow: 0 4px 14px rgba(15,23,42,.08);
  user-select: none;
  z-index: 2;
  transition: box-shadow .15s, border-color .15s, transform .12s;
  cursor: pointer;
}
.node:hover { box-shadow: 0 8px 22px rgba(15,23,42,.12); transform: translateY(-1px); }
.node.selected {
  border-color: var(--finora-blue);
  box-shadow: 0 0 0 3px rgba(61,99,245,.18), 0 8px 22px rgba(15,23,42,.12);
}
.node-head {
  display: flex; align-items: center; gap: 10px;
  padding: 10px 12px;
  border-bottom: 1px solid var(--finora-border-soft);
}
.node-ico {
  width: 30px; height: 30px;
  border-radius: 8px;
  display: grid; place-items: center;
  flex: 0 0 30px;
}
.node-ico svg { width: 15px; height: 15px; }
.node-title { font-weight: 700; font-size: 13px; }
.node-sub { font-size: 11px; color: var(--finora-text-soft); margin-top: 1px; }
.node-body { padding: 8px 12px; font-size: 12px; }
.node-row {
  display: flex; align-items: center; justify-content: space-between;
  padding: 4px 0;
  color: var(--finora-text-soft);
}
.node-row .v { color: var(--finora-text); font-weight: 600; }
.node-row .v.tag {
  font-size: 11px;
  padding: 2px 8px;
  background: var(--finora-bg);
  border-radius: 5px;
  font-weight: 600;
}
.node-foot {
  display: flex; align-items: center; justify-content: space-between;
  padding: 8px 12px;
  border-top: 1px solid var(--finora-border-soft);
  font-size: 11px;
  color: var(--finora-text-soft);
}
.node-status {
  display: inline-flex; align-items: center; gap: 6px;
  padding: 3px 8px;
  border-radius: 999px;
  background: #DCFCE7;
  color: #16A34A;
  font-weight: 700;
  font-size: 10px;
}
.node-status .dot { width: 5px; height: 5px; background: #16A34A; border-radius: 50%; }
.node-status.warn { background: #FEF3C7; color: #D97706; }
.node-status.warn .dot { background: #D97706; }
.node-status.idle { background: var(--finora-bg); color: var(--finora-text-soft); }
.node-status.idle .dot { background: var(--finora-text-soft); }

/* node accent stripe on top by category */
.node.cat-trigger { border-top: 3px solid #3D63F5; }
.node.cat-trigger .node-ico { background:#EEF2FF; color:#3D63F5; }
.node.cat-action  { border-top: 3px solid #8B5CF6; }
.node.cat-action  .node-ico { background:#F3E8FF; color:#8B5CF6; }
.node.cat-check   { border-top: 3px solid #16A34A; }
.node.cat-check   .node-ico { background:#DCFCE7; color:#16A34A; }
.node.cat-logic   { border-top: 3px solid #D97706; }
.node.cat-logic   .node-ico { background:#FEF3C7; color:#D97706; }
.node.cat-mailbox { border-top: 3px solid #0891B2; }
.node.cat-mailbox .node-ico { background:#CFFAFE; color:#0891B2; }
.node.cat-expert  { border-top: 3px solid #DB2777; }
.node.cat-expert  .node-ico { background:#FCE7F3; color:#DB2777; }
.node.cat-server  { border-top: 3px solid #0F766E; }
.node.cat-server  .node-ico { background:#CCFBF1; color:#0F766E; }

/* ports */
.port {
  position: absolute;
  width: 12px; height: 12px;
  border-radius: 50%;
  background: #fff;
  border: 2px solid #CBD5E1;
  z-index: 3;
}
.port.in  { left: -7px; top: 50%; transform: translateY(-50%); }
.port.out { right: -7px; top: 50%; transform: translateY(-50%); }
.port.connected { background: var(--finora-blue); border-color: var(--finora-blue); }

/* wires (SVG) */
.wires {
  position: absolute; inset: 0;
  pointer-events: none;
  z-index: 1;
  overflow: visible;
}
.wires path {
  stroke: var(--finora-blue);
  stroke-width: 2;
  fill: none;
  stroke-dasharray: 6 6;
  animation: wire-flow 1.4s linear infinite;
  opacity: .85;
}
@keyframes wire-flow { to { stroke-dashoffset: -24; } }
.wires path.warn { stroke: #D97706; }
.wires path.purple { stroke: #8B5CF6; }

/* drop zone hint when dragging from library */
.bld-canvas-wrap.drop-active::after {
  content: "Hier ablegen";
  position: absolute;
  inset: 16px;
  border: 2.5px dashed var(--finora-blue);
  background: rgba(61,99,245,.05);
  border-radius: 16px;
  display: grid; place-items: center;
  color: var(--finora-blue);
  font-weight: 700;
  font-size: 16px;
  pointer-events: none;
  z-index: 5;
}

/* ===== PROPERTIES (RIGHT) ===== */
.bld-props {
  position: relative;
  background: #fff;
  border-left: 1px solid var(--finora-border);
  overflow: hidden;
  display: flex; flex-direction: column;
  min-height: 0;
}
.bld-props::after {
  content: "";
  position: absolute;
  left: 0;
  right: 0;
  bottom: 0;
  height: 28px;
  background: linear-gradient(180deg, rgba(255,255,255,0), #fff 76%);
  pointer-events: none;
  z-index: 3;
}
.props-head {
  padding: 14px 18px;
  border-bottom: 1px solid var(--finora-border-soft);
  display: flex; align-items: center; gap: 12px;
  flex: 0 0 auto;
}
.props-head .ico {
  width: 38px; height: 38px;
  border-radius: 10px;
  display: grid; place-items: center;
  background:#F3E8FF;
  color:#8B5CF6;
}
.props-head .ico svg { width: 18px; height: 18px; }
.props-head .name { font-weight: 700; font-size: 14px; }
.props-head .sub { font-size: 11px; color: var(--finora-text-soft); margin-top: 2px; }

.props-tabs {
  display: flex;
  border-bottom: 1px solid var(--finora-border-soft);
  padding: 0 14px;
  flex: 0 0 auto;
  background: #fff;
  z-index: 4;
}
.props-tab {
  padding: 12px 12px;
  font-size: 12px;
  font-weight: 600;
  color: var(--finora-text-soft);
  border-bottom: 2px solid transparent;
  cursor: pointer;
  margin-right: 4px;
}
.props-tab:hover { color: var(--finora-text); }
.props-tab.active {
  color: var(--finora-blue);
  border-bottom-color: var(--finora-blue);
}

.props-body {
  padding: 14px 18px 42px;
  overflow-y: auto;
  overflow-x: hidden;
  flex: 1;
  min-height: 0;
  scrollbar-gutter: stable;
  overscroll-behavior: contain;
  -webkit-overflow-scrolling: touch;
}

.empty-props {
  padding: 40px 20px;
  text-align: center;
  color: var(--finora-text-soft);
}
.empty-props .big-ic {
  width: 56px; height: 56px;
  margin: 0 auto 14px;
  border-radius: 16px;
  background: var(--finora-bg);
  display: grid; place-items: center;
  color: var(--finora-text-soft);
}
.empty-props .big-ic svg { width: 24px; height: 24px; }
.empty-props .t { font-weight: 600; color: var(--finora-text); margin-bottom: 4px; }
.empty-props .d { font-size: 12px; }

/* prop sections */
.prop-section { margin-bottom: 22px; }
.prop-section-title {
  display: flex; align-items: center; gap: 8px;
  font-size: 10px; font-weight: 700;
  text-transform: uppercase;
  letter-spacing: .08em;
  color: var(--finora-text-soft);
  margin-bottom: 10px;
}
.prop-section-title svg { width: 12px; height: 12px; }

.prop-field { margin-bottom: 12px; }
.prop-label {
  display: flex; align-items: center; gap: 6px;
  font-size: 12px;
  font-weight: 600;
  color: var(--finora-text);
  margin-bottom: 6px;
}
.prop-label .req { color: #DC2626; }
.prop-help {
  font-size: 11px;
  color: var(--finora-text-soft);
  margin-top: 5px;
  line-height: 1.4;
}

.prop-input, .prop-select, .prop-textarea {
  width: 100%;
  padding: 9px 12px;
  background: #fff;
  border: 1px solid var(--finora-border);
  border-radius: 9px;
  color: var(--finora-text);
  font-size: 13px;
  outline: none;
  transition: border-color .12s;
  font-family: inherit;
}
.prop-input:focus, .prop-select:focus, .prop-textarea:focus {
  border-color: var(--finora-blue);
  box-shadow: 0 0 0 3px rgba(61,99,245,.10);
}
.prop-textarea { resize: vertical; min-height: 64px; }
.prop-textarea[rows="5"] { min-height: 118px; }
.prop-select {
  appearance: none;
  background-image: url("data:image/svg+xml;charset=UTF-8,%3csvg xmlns='http://www.w3.org/2000/svg' width='14' height='14' viewBox='0 0 24 24' fill='none' stroke='%2364748B' stroke-width='2.5' stroke-linecap='round' stroke-linejoin='round'%3e%3cpolyline points='6 9 12 15 18 9'/%3e%3c/svg%3e");
  background-repeat: no-repeat;
  background-position: right 12px center;
  padding-right: 36px;
  cursor: pointer;
}

.dryrun-card {
  margin: 0 0 18px;
  padding: 14px;
  border: 1px solid rgba(14, 165, 233, .24);
  border-radius: 16px;
  background:
    radial-gradient(circle at 12% 0%, rgba(56, 189, 248, .18), transparent 36%),
    linear-gradient(135deg, rgba(240, 249, 255, .96), rgba(255, 255, 255, .98));
  box-shadow: 0 14px 30px rgba(15, 23, 42, .06);
}
.dryrun-kicker {
  font-size: 10px;
  font-weight: 800;
  letter-spacing: .1em;
  text-transform: uppercase;
  color: #0369A1;
  margin-bottom: 6px;
}
.dryrun-title {
  font-size: 14px;
  font-weight: 800;
  color: var(--finora-text);
  margin-bottom: 4px;
}
.dryrun-detail {
  font-size: 12px;
  line-height: 1.45;
  color: var(--finora-text-soft);
}
.dryrun-card ul {
  margin: 10px 0 0;
  padding-left: 18px;
  font-size: 12px;
  line-height: 1.5;
  color: var(--finora-text);
}
.dryrun-flags {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  margin-top: 12px;
}
.dryrun-flags span {
  padding: 5px 8px;
  border-radius: 999px;
  background: rgba(14, 165, 233, .12);
  color: #075985;
  font-size: 11px;
  font-weight: 700;
}

/* toggle row */
.toggle-row {
  display: flex; align-items: center; justify-content: space-between;
  padding: 10px 12px;
  background: var(--finora-bg);
  border: 1px solid var(--finora-border-soft);
  border-radius: 10px;
  margin-bottom: 8px;
}
.toggle-row .info { flex: 1; }
.toggle-row .info .t { font-size: 13px; font-weight: 600; }
.toggle-row .info .d { font-size: 11px; color: var(--finora-text-soft); margin-top: 1px; }
.toggle {
  width: 36px; height: 20px;
  background: #CBD5E1;
  border-radius: 999px;
  position: relative;
  cursor: pointer;
  transition: background .15s;
  flex: 0 0 36px;
}
.toggle::after {
  content: "";
  position: absolute;
  top: 2px; left: 2px;
  width: 16px; height: 16px;
  border-radius: 50%;
  background: #fff;
  transition: left .15s;
  box-shadow: 0 1px 3px rgba(0,0,0,.10);
}
.toggle.on { background: var(--finora-blue); }
.toggle.on::after { left: 18px; }

/* sender picker */
.sender-picker {
  display: flex; align-items: center; gap: 10px;
  padding: 10px 12px;
  background: #fff;
  border: 1px solid var(--finora-border);
  border-radius: 10px;
  margin-bottom: 6px;
  cursor: pointer;
}
.sender-picker:hover { border-color: var(--finora-text-soft); }
.sender-picker.selected {
  border-color: var(--finora-blue);
  background: var(--finora-blue-soft);
}
.sender-picker .avatar {
  width: 32px; height: 32px;
  border-radius: 9px;
  background: linear-gradient(135deg, #FB923C, #F59E0B);
  display: grid; place-items: center;
  color: white; font-weight: 700; font-size: 12px;
  flex: 0 0 32px;
}
.sender-picker .name { font-weight: 600; font-size: 13px; }
.sender-picker .mail { font-size: 11px; color: var(--finora-text-soft); }
.sender-picker svg { margin-left: auto; width: 14px; height: 14px; color: var(--finora-text-soft); }
.sender-picker.selected svg { color: var(--finora-blue); }

/* condition row */
.cond-row {
  display: grid;
  grid-template-columns: 1.2fr .8fr 1.2fr 32px;
  gap: 6px;
  margin-bottom: 6px;
}
.cond-row .prop-select, .cond-row .prop-input { padding: 7px 8px; font-size: 12px; }
.cond-del {
  width: 32px; height: 32px;
  border-radius: 8px;
  background: #FEE2E2;
  color: #DC2626;
  display: grid; place-items: center;
}
.cond-del:hover { background: #FECACA; }
.cond-del svg { width: 12px; height: 12px; }

.add-row-btn {
  width: 100%;
  padding: 8px;
  border: 1px dashed var(--finora-border);
  border-radius: 8px;
  background: transparent;
  color: var(--finora-text-soft);
  font-size: 12px;
  font-weight: 600;
  cursor: pointer;
}
.add-row-btn:hover { background: var(--finora-blue-soft); border-color: var(--finora-blue); color: var(--finora-blue); }

/* check list */
.check-row {
  display: flex; align-items: center; gap: 10px;
  padding: 6px 0;
  font-size: 12px;
}
.check-box {
  width: 18px; height: 18px;
  border-radius: 5px;
  border: 1.5px solid var(--finora-border);
  background: #fff;
  display: grid; place-items: center;
  flex: 0 0 18px;
  cursor: pointer;
}
.check-box.on {
  background: var(--finora-blue);
  border-color: var(--finora-blue);
  color: #fff;
}
.check-box.on svg { width: 11px; height: 11px; }
.check-row .var { color: var(--finora-text-soft); margin-left: auto; font-family: ui-monospace, SFMono-Regular, Menlo, monospace; font-size: 11px; }

/* expert-only section visual */
.expert-only {
  position: relative;
}
.expert-only .prop-section-title::after {
  content: "EXPERT";
  margin-left: 6px;
  padding: 2px 6px;
  font-size: 9px;
  font-weight: 700;
  letter-spacing: .04em;
  background: linear-gradient(135deg, #8B5CF6, #EC4899);
  color: #fff;
  border-radius: 4px;
}

/* easy mode notice card */
.easy-notice {
  background: linear-gradient(135deg, #EEF2FF, #FCE7F3);
  border: 1px solid var(--finora-border);
  border-radius: 12px;
  padding: 12px 14px;
  margin-bottom: 16px;
  display: flex; gap: 12px;
  align-items: flex-start;
}
.easy-notice .ic {
  width: 30px; height: 30px;
  border-radius: 8px;
  background: linear-gradient(135deg, #3D63F5, #5B7CFF);
  color: white;
  display: grid; place-items: center;
  flex: 0 0 30px;
}
.easy-notice .ic svg { width: 15px; height: 15px; }
.easy-notice .t { font-weight: 700; font-size: 12px; }
.easy-notice .d { font-size: 11px; color: var(--finora-text-soft); margin-top: 2px; line-height: 1.4; }

/* ============================================
   EXPERT MODE — Dark neon override
   Applies to body.builder.expert-mode
   ============================================ */
body.builder.expert-mode {
  --finora-bg: #07070C;
  --finora-card: #14141F;
  --finora-text: #E9EAF3;
  --finora-text-soft: #8A8DA8;
  --finora-border: rgba(255,255,255,.10);
  --finora-border-soft: rgba(255,255,255,.06);
  --finora-blue: #00E5FF;
  --finora-blue-dark: #00B8CC;
  --finora-blue-soft: rgba(0,229,255,.12);
  background: #07070C;
  color: #E9EAF3;
}

body.builder.expert-mode::before {
  content: "";
  position: fixed; inset: 0;
  background:
    radial-gradient(800px 500px at 20% 0%, rgba(0,229,255,.08), transparent 70%),
    radial-gradient(900px 600px at 85% 100%, rgba(177,76,255,.07), transparent 70%),
    radial-gradient(600px 400px at 55% 50%, rgba(255,61,203,.05), transparent 70%);
  pointer-events: none;
  z-index: 0;
}
body.builder.expert-mode .app { position: relative; z-index: 1; }

/* Sidebar */
body.builder.expert-mode .sidebar {
  background: linear-gradient(180deg, #0B0B16 0%, #08080F 100%);
  border-right-color: rgba(255,255,255,.08);
}
body.builder.expert-mode .brand-logo {
  background: linear-gradient(135deg, #00E5FF, #B14CFF);
  color: #07070C;
  box-shadow: 0 0 24px rgba(0,229,255,.40);
}
body.builder.expert-mode .brand-name {
  background: linear-gradient(90deg, #00E5FF, #B14CFF);
  -webkit-background-clip: text; background-clip: text;
  color: transparent;
}
body.builder.expert-mode .nav-item { color: #8A8DA8; }
body.builder.expert-mode .nav-item:hover { background: rgba(255,255,255,.05); color: #E9EAF3; }
body.builder.expert-mode .nav-item.active {
  background: linear-gradient(90deg, rgba(0,229,255,.12), rgba(177,76,255,.10));
  color: #E9EAF3;
  box-shadow: inset 0 0 0 1px rgba(0,229,255,.20);
}
body.builder.expert-mode .nav-badge {
  background: #00E5FF; color: #07070C;
  box-shadow: 0 0 10px rgba(0,229,255,.5);
}
body.builder.expert-mode .nav-dot {
  background: #5BFFA8;
  box-shadow: 0 0 0 3px rgba(91,255,168,.18);
}
body.builder.expert-mode .sidebar-org {
  border-top-color: rgba(255,255,255,.06);
}

/* Topbar */
body.builder.expert-mode .topbar {
  background: rgba(13,13,23,.85);
  backdrop-filter: blur(14px);
  border-bottom-color: rgba(255,255,255,.08);
}
body.builder.expert-mode .tab { color: #8A8DA8; }
body.builder.expert-mode .tab:hover { color: #E9EAF3; }
body.builder.expert-mode .tab.active { color: #00E5FF; }
body.builder.expert-mode .tab.active::after {
  background: linear-gradient(90deg, #00E5FF, #B14CFF);
  box-shadow: 0 0 8px #00E5FF;
}
body.builder.expert-mode .search {
  background: rgba(255,255,255,.04);
  border-color: rgba(255,255,255,.08);
  color: #8A8DA8;
}
body.builder.expert-mode .search input { color: #E9EAF3; }
body.builder.expert-mode .search-shortcut {
  background: rgba(255,255,255,.04);
  border-color: rgba(255,255,255,.10);
  color: #8A8DA8;
}
body.builder.expert-mode .icon-btn { color: #8A8DA8; }
body.builder.expert-mode .icon-btn:hover { background: rgba(255,255,255,.05); color: #E9EAF3; }
body.builder.expert-mode .icon-btn .badge { border-color: #14141F; }
body.builder.expert-mode .user-chip {
  border-color: rgba(255,255,255,.08);
}
body.builder.expert-mode .user-chip:hover { background: rgba(255,255,255,.05); }
body.builder.expert-mode .user-chip .user-role { color: #8A8DA8; }

/* Builder bar */
body.builder.expert-mode .bld-bar {
  background: rgba(13,13,23,.85);
  border-bottom-color: rgba(255,255,255,.08);
}
body.builder.expert-mode .bld-title-edit {
  background: rgba(255,255,255,.04);
  border-color: rgba(255,255,255,.10);
}
body.builder.expert-mode .crumbs { color: #8A8DA8; }
body.builder.expert-mode .crumbs .sep { color: #5A5C75; }
body.builder.expert-mode .mode-toggle {
  background: rgba(255,255,255,.04);
  border: 1px solid rgba(255,255,255,.08);
}
body.builder.expert-mode .mode-btn { color: #8A8DA8; }
body.builder.expert-mode .mode-btn:hover { color: #E9EAF3; }
body.builder.expert-mode .mode-btn.active {
  background: rgba(0,229,255,.15);
  color: #00E5FF;
  box-shadow: inset 0 0 0 1px rgba(0,229,255,.30);
}
body.builder.expert-mode .mode-btn.expert.active {
  background: linear-gradient(135deg, #B14CFF, #FF3DCB);
  color: white;
  box-shadow: 0 4px 16px rgba(255,61,203,.40);
}
body.builder.expert-mode .bld-status {
  background: rgba(91,255,168,.10);
  color: #5BFFA8;
}
body.builder.expert-mode .bld-status::before {
  background: #5BFFA8;
  box-shadow: 0 0 8px #5BFFA8;
}
body.builder.expert-mode .btn {
  background: rgba(255,255,255,.04);
  border-color: rgba(255,255,255,.10);
  color: #E9EAF3;
}
body.builder.expert-mode .btn:hover {
  background: rgba(255,255,255,.08);
  border-color: rgba(255,255,255,.16);
}
body.builder.expert-mode .btn.ghost { background: transparent; }
body.builder.expert-mode .btn.primary {
  background: linear-gradient(135deg, #00E5FF, #B14CFF);
  color: #07070C;
  border-color: transparent;
  box-shadow: 0 0 24px rgba(0,229,255,.30);
}
body.builder.expert-mode .btn.primary:hover {
  filter: brightness(1.1);
  box-shadow: 0 0 32px rgba(0,229,255,.50);
}

/* Library */
body.builder.expert-mode .bld-lib {
  background: linear-gradient(180deg, rgba(13,13,23,.95) 0%, rgba(7,7,12,.95) 100%);
  border-right-color: rgba(255,255,255,.08);
}
body.builder.expert-mode .bld-lib::after {
  background: linear-gradient(180deg, rgba(7,7,12,0), rgba(7,7,12,.98) 76%);
}
body.builder.expert-mode .lib-search {
  background: rgba(255,255,255,.04);
  border-color: rgba(255,255,255,.08);
  box-shadow: 0 12px 24px rgba(7,7,12,.78);
}
body.builder.expert-mode .lib-search input { color: #E9EAF3; }
body.builder.expert-mode .lib-search svg { color: #5A5C75; }
body.builder.expert-mode .lib-group-h { color: #5A5C75; }
body.builder.expert-mode .lib-group-h .line { background: rgba(255,255,255,.06); }
body.builder.expert-mode .lib-block {
  background: rgba(255,255,255,.02);
  border-color: rgba(255,255,255,.06);
  color: #E9EAF3;
}
body.builder.expert-mode .lib-block:hover {
  background: rgba(255,255,255,.06);
  border-color: rgba(255,255,255,.12);
}
body.builder.expert-mode .lib-block .desc { color: #5A5C75; }

/* category icons get neon glow in expert */
body.builder.expert-mode .lib-block.cat-trigger .ico { background: rgba(0,229,255,.14); color: #00E5FF; box-shadow: inset 0 0 0 1px rgba(0,229,255,.30), 0 0 12px rgba(0,229,255,.20); }
body.builder.expert-mode .lib-block.cat-action  .ico { background: rgba(177,76,255,.14); color: #B14CFF; box-shadow: inset 0 0 0 1px rgba(177,76,255,.30), 0 0 12px rgba(177,76,255,.20); }
body.builder.expert-mode .lib-block.cat-check   .ico { background: rgba(91,255,168,.14); color: #5BFFA8; box-shadow: inset 0 0 0 1px rgba(91,255,168,.30), 0 0 12px rgba(91,255,168,.20); }
body.builder.expert-mode .lib-block.cat-logic   .ico { background: rgba(255,210,63,.14); color: #FFD23F; box-shadow: inset 0 0 0 1px rgba(255,210,63,.30), 0 0 12px rgba(255,210,63,.20); }
body.builder.expert-mode .lib-block.cat-mailbox .ico { background: rgba(77,141,255,.14); color: #4D8DFF; box-shadow: inset 0 0 0 1px rgba(77,141,255,.30), 0 0 12px rgba(77,141,255,.20); }
body.builder.expert-mode .lib-block.cat-expert  .ico { background: rgba(255,61,203,.14); color: #FF3DCB; box-shadow: inset 0 0 0 1px rgba(255,61,203,.30), 0 0 12px rgba(255,61,203,.20); }
body.builder.expert-mode .lib-block.cat-ai      .ico { background: rgba(91,255,168,.14); color: #5BFFA8; box-shadow: inset 0 0 0 1px rgba(91,255,168,.30), 0 0 14px rgba(91,255,168,.30); }
body.builder.expert-mode .lib-block.cat-data    .ico { background: rgba(255,150,77,.14); color: #FF965B; box-shadow: inset 0 0 0 1px rgba(255,150,77,.30), 0 0 12px rgba(255,150,77,.20); }
body.builder.expert-mode .lib-block.cat-flow    .ico { background: rgba(255,210,63,.14); color: #FFD23F; box-shadow: inset 0 0 0 1px rgba(255,210,63,.30), 0 0 12px rgba(255,210,63,.20); }
body.builder.expert-mode .lib-block.cat-server  .ico { background: rgba(45,212,191,.14); color: #2DD4BF; box-shadow: inset 0 0 0 1px rgba(45,212,191,.30), 0 0 12px rgba(45,212,191,.22); }

/* Canvas */
body.builder.expert-mode .bld-canvas-wrap {
  background: #07070C;
}
body.builder.expert-mode .bld-canvas {
  background-image:
    radial-gradient(circle, rgba(255,255,255,.06) 1px, transparent 1px);
}
body.builder.expert-mode .canvas-tool {
  background: rgba(20,20,31,.85);
  backdrop-filter: blur(10px);
  border-color: rgba(255,255,255,.08);
  color: #8A8DA8;
}
body.builder.expert-mode .canvas-tool:hover { background: rgba(35,35,54,.90); color: #E9EAF3; }
body.builder.expert-mode .canvas-tool.active {
  background: rgba(0,229,255,.15);
  color: #00E5FF;
  border-color: rgba(0,229,255,.40);
  box-shadow: 0 0 16px rgba(0,229,255,.25);
}
body.builder.expert-mode .canvas-zoom {
  background: rgba(20,20,31,.85);
  border-color: rgba(255,255,255,.08);
  backdrop-filter: blur(10px);
}
body.builder.expert-mode .canvas-zoom button { color: #8A8DA8; }
body.builder.expert-mode .canvas-zoom button:hover { background: rgba(255,255,255,.06); color: #E9EAF3; }
body.builder.expert-mode .canvas-zoom .val { color: #8A8DA8; }
body.builder.expert-mode .canvas-hint { color: #5A5C75; }
body.builder.expert-mode .canvas-hint .big { color: #E9EAF3; }

/* Nodes — neon */
body.builder.expert-mode .node {
  background: linear-gradient(180deg, #14141F, #0E0E18);
  border-color: rgba(255,255,255,.10);
  box-shadow: 0 12px 40px rgba(0,0,0,.50);
  color: #E9EAF3;
}
body.builder.expert-mode .node:hover {
  box-shadow: 0 18px 50px rgba(0,0,0,.60);
}
body.builder.expert-mode .node.selected {
  border-color: rgba(0,229,255,.50);
  box-shadow: 0 0 0 1px rgba(0,229,255,.50), 0 0 32px rgba(0,229,255,.30), 0 12px 40px rgba(0,0,0,.60);
}
body.builder.expert-mode .node-head { border-bottom-color: rgba(255,255,255,.08); }
body.builder.expert-mode .node-sub { color: #5A5C75; }
body.builder.expert-mode .node-row { color: #8A8DA8; }
body.builder.expert-mode .node-row .v { color: #E9EAF3; }
body.builder.expert-mode .node-row .v.tag { background: rgba(255,255,255,.06); }
body.builder.expert-mode .node-foot {
  border-top-color: rgba(255,255,255,.08);
  color: #5A5C75;
}
body.builder.expert-mode .node-status { background: rgba(91,255,168,.10); color: #5BFFA8; }
body.builder.expert-mode .node-status .dot { background: #5BFFA8; box-shadow: 0 0 6px #5BFFA8; }
body.builder.expert-mode .node-status.warn { background: rgba(255,210,63,.10); color: #FFD23F; }
body.builder.expert-mode .node-status.warn .dot { background: #FFD23F; box-shadow: 0 0 6px #FFD23F; }
body.builder.expert-mode .node-status.idle { background: rgba(255,255,255,.05); color: #5A5C75; }
body.builder.expert-mode .node-status.idle .dot { background: #5A5C75; box-shadow: none; }

/* node neon stripe + icons */
body.builder.expert-mode .node.cat-trigger { border-top: 2px solid #00E5FF; box-shadow: 0 -10px 24px -10px rgba(0,229,255,.50), 0 12px 40px rgba(0,0,0,.50); }
body.builder.expert-mode .node.cat-trigger .node-ico { background: rgba(0,229,255,.14); color: #00E5FF; box-shadow: inset 0 0 0 1px rgba(0,229,255,.30); }
body.builder.expert-mode .node.cat-action  { border-top: 2px solid #B14CFF; box-shadow: 0 -10px 24px -10px rgba(177,76,255,.50), 0 12px 40px rgba(0,0,0,.50); }
body.builder.expert-mode .node.cat-action  .node-ico { background: rgba(177,76,255,.14); color: #B14CFF; box-shadow: inset 0 0 0 1px rgba(177,76,255,.30); }
body.builder.expert-mode .node.cat-check   { border-top: 2px solid #5BFFA8; box-shadow: 0 -10px 24px -10px rgba(91,255,168,.50), 0 12px 40px rgba(0,0,0,.50); }
body.builder.expert-mode .node.cat-check   .node-ico { background: rgba(91,255,168,.14); color: #5BFFA8; box-shadow: inset 0 0 0 1px rgba(91,255,168,.30); }
body.builder.expert-mode .node.cat-logic   { border-top: 2px solid #FFD23F; }
body.builder.expert-mode .node.cat-logic   .node-ico { background: rgba(255,210,63,.14); color: #FFD23F; box-shadow: inset 0 0 0 1px rgba(255,210,63,.30); }
body.builder.expert-mode .node.cat-mailbox { border-top: 2px solid #4D8DFF; }
body.builder.expert-mode .node.cat-mailbox .node-ico { background: rgba(77,141,255,.14); color: #4D8DFF; box-shadow: inset 0 0 0 1px rgba(77,141,255,.30); }
body.builder.expert-mode .node.cat-expert  { border-top: 2px solid #FF3DCB; box-shadow: 0 -10px 24px -10px rgba(255,61,203,.50), 0 12px 40px rgba(0,0,0,.50); }
body.builder.expert-mode .node.cat-expert  .node-ico { background: rgba(255,61,203,.14); color: #FF3DCB; box-shadow: inset 0 0 0 1px rgba(255,61,203,.30); }
body.builder.expert-mode .node.cat-ai      { border-top: 2px solid #5BFFA8; }
body.builder.expert-mode .node.cat-ai      .node-ico { background: rgba(91,255,168,.14); color: #5BFFA8; box-shadow: inset 0 0 0 1px rgba(91,255,168,.30); }
body.builder.expert-mode .node.cat-data    { border-top: 2px solid #FF965B; }
body.builder.expert-mode .node.cat-data    .node-ico { background: rgba(255,150,77,.14); color: #FF965B; box-shadow: inset 0 0 0 1px rgba(255,150,77,.30); }
body.builder.expert-mode .node.cat-flow    { border-top: 2px solid #FFD23F; }
body.builder.expert-mode .node.cat-flow    .node-ico { background: rgba(255,210,63,.14); color: #FFD23F; box-shadow: inset 0 0 0 1px rgba(255,210,63,.30); }
body.builder.expert-mode .node.cat-server  { border-top: 2px solid #2DD4BF; box-shadow: 0 -10px 24px -10px rgba(45,212,191,.45), 0 12px 40px rgba(0,0,0,.50); }
body.builder.expert-mode .node.cat-server  .node-ico { background: rgba(45,212,191,.14); color: #2DD4BF; box-shadow: inset 0 0 0 1px rgba(45,212,191,.30); }

body.builder.expert-mode .port {
  background: #14141F;
  border-color: rgba(255,255,255,.30);
}
body.builder.expert-mode .port.connected {
  background: #00E5FF;
  border-color: #00E5FF;
  box-shadow: 0 0 10px #00E5FF;
}
body.builder.expert-mode .wires path {
  stroke: #00E5FF;
  filter: drop-shadow(0 0 6px #00E5FF);
}
body.builder.expert-mode .wires path.purple { stroke: #B14CFF; filter: drop-shadow(0 0 6px #B14CFF); }
body.builder.expert-mode .wires path.warn   { stroke: #FFD23F; filter: drop-shadow(0 0 6px #FFD23F); }

/* Properties */
body.builder.expert-mode .bld-props {
  background: linear-gradient(180deg, rgba(13,13,23,.96), rgba(7,7,12,.96));
  border-left-color: rgba(255,255,255,.08);
}
body.builder.expert-mode .bld-props::after {
  background: linear-gradient(180deg, rgba(7,7,12,0), rgba(7,7,12,.98) 76%);
}
body.builder.expert-mode .props-head { border-bottom-color: rgba(255,255,255,.08); }
body.builder.expert-mode .props-tabs { background: rgba(13,13,23,.96); }
body.builder.expert-mode .props-tab { color: #8A8DA8; }
body.builder.expert-mode .props-tab:hover { color: #E9EAF3; }
body.builder.expert-mode .props-tab.active {
  color: #00E5FF;
  border-bottom-color: #00E5FF;
  box-shadow: 0 1px 12px -4px #00E5FF;
}
body.builder.expert-mode .empty-props .big-ic {
  background: rgba(255,255,255,.04);
  color: #5A5C75;
}
body.builder.expert-mode .prop-section-title { color: #5A5C75; }
body.builder.expert-mode .prop-label { color: #8A8DA8; }
body.builder.expert-mode .prop-help { color: #5A5C75; }
body.builder.expert-mode .prop-input,
body.builder.expert-mode .prop-select,
body.builder.expert-mode .prop-textarea {
  background: rgba(255,255,255,.03);
  border-color: rgba(255,255,255,.10);
  color: #E9EAF3;
}
body.builder.expert-mode .prop-input:focus,
body.builder.expert-mode .prop-select:focus,
body.builder.expert-mode .prop-textarea:focus {
  border-color: rgba(0,229,255,.40);
  box-shadow: 0 0 0 3px rgba(0,229,255,.10);
}
body.builder.expert-mode .dryrun-card {
  border-color: rgba(56,189,248,.22);
  background:
    radial-gradient(circle at 12% 0%, rgba(56,189,248,.16), transparent 34%),
    linear-gradient(135deg, rgba(18,24,45,.96), rgba(13,13,23,.98));
  box-shadow: 0 18px 42px rgba(0,0,0,.22);
}
body.builder.expert-mode .dryrun-title,
body.builder.expert-mode .dryrun-card ul {
  color: #E9EAF3;
}
body.builder.expert-mode .dryrun-detail {
  color: #8A8DA8;
}
body.builder.expert-mode .prop-select {
  background-image: url("data:image/svg+xml;charset=UTF-8,%3csvg xmlns='http://www.w3.org/2000/svg' width='14' height='14' viewBox='0 0 24 24' fill='none' stroke='%238A8DA8' stroke-width='2.5' stroke-linecap='round' stroke-linejoin='round'%3e%3cpolyline points='6 9 12 15 18 9'/%3e%3c/svg%3e");
}
body.builder.expert-mode .toggle-row {
  background: rgba(255,255,255,.03);
  border-color: rgba(255,255,255,.06);
}
body.builder.expert-mode .toggle { background: rgba(255,255,255,.10); }
body.builder.expert-mode .toggle.on {
  background: #00E5FF;
  box-shadow: 0 0 12px rgba(0,229,255,.50);
}
body.builder.expert-mode .sender-picker {
  background: rgba(255,255,255,.03);
  border-color: rgba(255,255,255,.10);
}
body.builder.expert-mode .sender-picker:hover { border-color: rgba(255,255,255,.20); }
body.builder.expert-mode .sender-picker.selected {
  background: rgba(0,229,255,.06);
  border-color: rgba(0,229,255,.40);
}
body.builder.expert-mode .sender-picker .mail { color: #5A5C75; }
body.builder.expert-mode .add-row-btn {
  border-color: rgba(255,255,255,.16);
  color: #8A8DA8;
}
body.builder.expert-mode .add-row-btn:hover {
  background: rgba(0,229,255,.06);
  border-color: rgba(0,229,255,.40);
  color: #00E5FF;
}
body.builder.expert-mode .check-box {
  background: rgba(255,255,255,.04);
  border-color: rgba(255,255,255,.16);
}
body.builder.expert-mode .check-box.on {
  background: linear-gradient(135deg, #00E5FF, #B14CFF);
  border-color: transparent;
  color: #07070C;
}
body.builder.expert-mode .check-row .var { color: #5A5C75; }
body.builder.expert-mode .cond-del {
  background: rgba(255,90,111,.10);
  color: #FF5A6F;
}
body.builder.expert-mode .cond-del:hover { background: rgba(255,90,111,.20); }
body.builder.expert-mode .easy-notice {
  background: linear-gradient(135deg, rgba(0,229,255,.10), rgba(255,61,203,.08));
  border-color: rgba(0,229,255,.20);
}
body.builder.expert-mode .easy-notice .t { color: #E9EAF3; }
body.builder.expert-mode .easy-notice .d { color: #8A8DA8; }

/* drop active overlay in expert */
body.builder.expert-mode .bld-canvas-wrap.drop-active::after {
  border-color: #00E5FF;
  background: rgba(0,229,255,.05);
  color: #00E5FF;
  box-shadow: inset 0 0 60px rgba(0,229,255,.10);
}

/* show easy-only groups in easy, expert-only in expert */
body.builder.expert-mode .easy-only { display: none !important; }

/* PRO/AI tags */
.lib-block .pro.ai {
  background: linear-gradient(135deg, #5BFFA8, #00E5FF);
  color: #07070C;
}
.lib-block .pro.beta {
  background: linear-gradient(135deg, #F59E0B, #DC2626);
}
.lib-block .pro.server {
  background: linear-gradient(135deg, #0F766E, #14B8A6);
  color: #ECFEFF;
}

/* Pan cursor on canvas when holding space or middle mouse */
.bld-canvas.panning { cursor: grabbing; }

/* ===== Node running (test-run animation) ===== */
.node.running {
  box-shadow:
    0 0 0 3px rgba(61,99,245,.40),
    0 0 28px rgba(61,99,245,.30),
    0 8px 22px rgba(15,23,42,.12);
  animation: node-pulse 1s ease-in-out infinite;
}
@keyframes node-pulse {
  0%, 100% { transform: translateY(-1px) scale(1); }
  50%      { transform: translateY(-3px) scale(1.015); }
}
.node.running .node-status .dot {
  background: var(--finora-blue) !important;
  box-shadow: 0 0 8px var(--finora-blue);
  animation: pulse 0.6s ease-in-out infinite;
}
body.builder.expert-mode .node.running {
  box-shadow:
    0 0 0 3px rgba(0,229,255,.50),
    0 0 40px rgba(0,229,255,.40),
    0 12px 40px rgba(0,0,0,.60);
}
body.builder.expert-mode .node.running .node-status .dot {
  background: var(--neon-cyan, #00E5FF) !important;
  box-shadow: 0 0 10px var(--neon-cyan, #00E5FF);
}

/* Active wire (currently flowing data) */
.wires path.active {
  stroke-width: 3;
  filter: drop-shadow(0 0 8px currentColor);
  animation: wire-flow 0.6s linear infinite;
}

/* Wire preview while dragging from port */
#wire-preview path {
  stroke: var(--finora-blue);
  stroke-width: 2;
  fill: none;
  stroke-dasharray: 6 6;
  opacity: .8;
  animation: wire-flow 0.8s linear infinite;
}
body.builder.expert-mode #wire-preview path {
  stroke: var(--neon-cyan, #00E5FF);
  filter: drop-shadow(0 0 6px var(--neon-cyan, #00E5FF));
}

/* Wire-drag global cursor */
body.wiring,
body.wiring * {
  cursor: crosshair !important;
}
body.wiring .port {
  transform: scale(1.4) !important;
  box-shadow: 0 0 12px var(--finora-blue);
}
body.builder.expert-mode.wiring .port {
  box-shadow: 0 0 14px var(--neon-cyan, #00E5FF);
}

/* ===== Functional Mini-map ===== */
.minimap {
  position: absolute;
  bottom: 16px; right: 16px;
  width: 200px;
  height: 130px;
  background: #fff;
  border: 1px solid var(--finora-border);
  border-radius: 12px;
  padding: 8px;
  z-index: 6;
  box-shadow: 0 4px 14px rgba(15,23,42,.10);
}
body.builder.expert-mode .minimap {
  background: rgba(20,20,31,.85);
  border-color: rgba(255,255,255,.10);
  backdrop-filter: blur(10px);
}
.minimap .mm-grid {
  position: absolute;
  inset: 8px;
  background-image: radial-gradient(circle, rgba(15,23,42,.10) 1px, transparent 1px);
  background-size: 8px 8px;
  border-radius: 6px;
  pointer-events: none;
}
body.builder.expert-mode .minimap .mm-grid {
  background-image: radial-gradient(circle, rgba(255,255,255,.10) 1px, transparent 1px);
}
.minimap .mm-nodes {
  position: absolute;
  inset: 8px;
  pointer-events: none;
}
.minimap .mm-viewport {
  position: absolute;
  left: 8px;
  top: 8px;
  border: 1.5px solid var(--finora-blue);
  border-radius: 3px;
  pointer-events: none;
  box-shadow: 0 0 8px rgba(61,99,245,.30);
  background: rgba(61,99,245,.05);
}
body.builder.expert-mode .minimap .mm-viewport {
  border-color: var(--neon-cyan, #00E5FF);
  box-shadow: 0 0 10px rgba(0,229,255,.40);
  background: rgba(0,229,255,.06);
}

/* ===== Templates gallery modal ===== */
.tpl-backdrop {
  position: fixed; inset: 0;
  background: rgba(15,23,42,.50);
  backdrop-filter: blur(8px);
  z-index: 200;
  display: none;
  align-items: center;
  justify-content: center;
}
.tpl-backdrop.open { display: flex; }
body.builder.expert-mode .tpl-backdrop {
  background: rgba(7,7,12,.75);
}

.tpl-modal {
  background: #fff;
  border-radius: 20px;
  width: min(960px, 96vw);
  max-height: 88vh;
  display: flex;
  flex-direction: column;
  overflow: hidden;
  box-shadow: 0 32px 80px rgba(15,23,42,.32);
  animation: tpl-pop .25s cubic-bezier(.34,1.56,.64,1);
}
@keyframes tpl-pop {
  from { opacity: 0; transform: scale(.92); }
  to   { opacity: 1; transform: scale(1); }
}
body.builder.expert-mode .tpl-modal {
  background: linear-gradient(180deg, #14141F, #0E0E18);
  border: 1px solid rgba(0,229,255,.20);
  box-shadow: 0 32px 80px rgba(0,0,0,.60), 0 0 60px rgba(0,229,255,.15);
}

.tpl-head {
  padding: 24px 28px 12px;
  display: flex;
  align-items: center;
  gap: 14px;
}
.tpl-head .ic {
  width: 44px; height: 44px;
  border-radius: 12px;
  background: linear-gradient(135deg, #3D63F5, #8B5CF6);
  color: white;
  display: grid; place-items: center;
  box-shadow: 0 8px 20px rgba(61,99,245,.30);
}
.tpl-head .ic svg { width: 22px; height: 22px; }
.tpl-head .title { font-weight: 800; font-size: 20px; letter-spacing: -.01em; }
.tpl-head .sub   { font-size: 13px; color: var(--finora-text-soft); margin-top: 2px; }
.tpl-head .close {
  margin-left: auto;
  width: 36px; height: 36px;
  border-radius: 9px;
  display: grid; place-items: center;
  color: var(--finora-text-soft);
  cursor: pointer;
}
.tpl-head .close:hover { background: var(--finora-border-soft); color: var(--finora-text); }
body.builder.expert-mode .tpl-head .title { color: #E9EAF3; }
body.builder.expert-mode .tpl-head .sub   { color: #8A8DA8; }
body.builder.expert-mode .tpl-head .close { color: #8A8DA8; }
body.builder.expert-mode .tpl-head .close:hover { background: rgba(255,255,255,.06); color: #E9EAF3; }

.tpl-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 14px;
  padding: 12px 28px 28px;
  overflow-y: auto;
}
.tpl-card {
  background: #fff;
  border: 1.5px solid var(--finora-border);
  border-radius: 14px;
  padding: 16px;
  cursor: pointer;
  transition: border-color .15s, transform .12s, box-shadow .15s;
  display: flex;
  flex-direction: column;
  gap: 10px;
}
.tpl-card:hover {
  border-color: var(--finora-blue);
  transform: translateY(-3px);
  box-shadow: 0 12px 28px rgba(61,99,245,.16);
}
body.builder.expert-mode .tpl-card {
  background: rgba(255,255,255,.03);
  border-color: rgba(255,255,255,.08);
}
body.builder.expert-mode .tpl-card:hover {
  border-color: var(--neon-cyan, #00E5FF);
  box-shadow: 0 12px 28px rgba(0,229,255,.20);
}

.tpl-card .preview {
  height: 80px;
  background:
    linear-gradient(135deg, rgba(16,21,16,.96), rgba(24,34,27,.92)),
    var(--finora-bg);
  border-radius: 10px;
  display: flex; align-items: center; justify-content: center;
  gap: 6px;
  position: relative;
  overflow: hidden;
}
body.builder.expert-mode .tpl-card .preview {
  background: rgba(0,0,0,.30);
}
.tpl-card-visual {
  width: 100%;
  height: 100%;
  display: grid;
  grid-template-columns: 48px 1fr;
  grid-template-rows: 1fr auto;
  gap: 8px 10px;
  align-items: center;
  padding: 12px;
  position: relative;
}
.tpl-card-visual::after {
  content: "";
  position: absolute;
  inset: auto 0 0 0;
  height: 3px;
  background: var(--tpl-accent, #7CFF38);
}
.tpl-card-logo {
  grid-row: 1 / span 2;
  width: 42px;
  height: 42px;
  border-radius: 14px;
  background: rgba(255,255,255,.08);
  display: grid;
  place-items: center;
  box-shadow: inset 0 0 0 1px rgba(255,255,255,.08);
}
.tpl-card-logo img {
  width: 34px;
  height: 34px;
  object-fit: contain;
  display: block;
}
.tpl-card-lines {
  display: grid;
  gap: 6px;
}
.tpl-card-lines span {
  display: block;
  height: 7px;
  border-radius: 999px;
  background: rgba(255,255,255,.72);
}
.tpl-card-lines span:nth-child(1) { width: 76%; background: #fff; }
.tpl-card-lines span:nth-child(2) { width: 92%; }
.tpl-card-lines span:nth-child(3) { width: 58%; background: rgba(255,255,255,.48); }
.tpl-flow-dots {
  display: flex;
  gap: 5px;
  align-items: center;
}
.tpl-card .preview .dot {
  width: 18px; height: 18px;
  border-radius: 6px;
  display: grid; place-items: center;
  color: white;
  position: relative;
}
.tpl-card .preview .dot svg { width: 9px; height: 9px; }
.tpl-card .preview .dot:not(:last-child)::after {
  content: none;
}
body.builder.expert-mode .tpl-card .preview .dot:not(:last-child)::after {
  background: rgba(255,255,255,.20);
}
.tpl-card .preview .dot.c-trigger { background: #3D63F5; }
.tpl-card .preview .dot.c-mailbox { background: #0891B2; }
.tpl-card .preview .dot.c-check   { background: #16A34A; }
.tpl-card .preview .dot.c-logic   { background: #D97706; }
.tpl-card .preview .dot.c-action  { background: #8B5CF6; }
.tpl-card .preview .dot.c-flow    { background: #D97706; }
.tpl-card .preview .dot.c-ai      { background: #10B981; }
.tpl-card .preview .dot.c-data    { background: #64748B; }
.tpl-card .preview .dot.c-expert  { background: #DB2777; }
.tpl-card .preview .dot.c-server  { background: #0F766E; }

.tpl-card .name {
  font-weight: 700;
  font-size: 14px;
}
.tpl-card .tpl-family {
  color: var(--tpl-accent, #16A34A);
  font-size: 10px;
  font-weight: 900;
  letter-spacing: .08em;
  text-transform: uppercase;
}
body.builder.expert-mode .tpl-card .name { color: #E9EAF3; }
.tpl-card .desc {
  font-size: 12px;
  color: var(--finora-text-soft);
  line-height: 1.4;
}
.tpl-card .meta {
  display: flex; align-items: center; gap: 10px;
  font-size: 11px;
  color: var(--finora-text-soft);
  margin-top: auto;
}
.tpl-card .meta .pill {
  padding: 2px 7px;
  background: var(--finora-bg);
  border-radius: 999px;
  font-weight: 600;
}
body.builder.expert-mode .tpl-card .meta .pill {
  background: rgba(255,255,255,.06);
  color: #8A8DA8;
}

.tpl-card.blank {
  border-style: dashed;
}
.tpl-card.blank .preview { background: transparent; }

/* ===== Export/Import file input hidden ===== */
.io-hidden { display: none; }

/* ===== Keyboard shortcut hint ===== */
.kbd {
  display: inline-block;
  padding: 1px 5px;
  background: var(--finora-bg);
  border: 1px solid var(--finora-border);
  border-radius: 4px;
  font-size: 10px;
  font-family: ui-monospace, SFMono-Regular, Menlo, monospace;
  font-weight: 600;
  color: var(--finora-text-soft);
}
body.builder.expert-mode .kbd {
  background: rgba(255,255,255,.06);
  border-color: rgba(255,255,255,.12);
  color: #8A8DA8;
}

/* canvas-hint visible in empty state */
.canvas-hint {
  position: absolute;
  left: 50%; top: 35%;
  transform: translate(-50%, -50%);
  text-align: center;
  color: var(--finora-text-soft);
  font-size: 13px;
  pointer-events: none;
  z-index: 1;
}
body.builder.expert-mode .canvas-hint {
  color: #5A5C75;
}
body.builder.expert-mode .canvas-hint .big {
  color: #E9EAF3;
}

/* Zoom badge subtle pulse */
.zoom-toast {
  position: absolute;
  top: 60px; left: 50%;
  transform: translateX(-50%);
  background: rgba(13,13,23,.85);
  color: #E9EAF3;
  padding: 6px 14px;
  border-radius: 999px;
  font-size: 12px;
  font-weight: 700;
  border: 1px solid rgba(255,255,255,.10);
  z-index: 10;
  opacity: 0;
  pointer-events: none;
  transition: opacity .2s;
}
.zoom-toast.show { opacity: 1; }
body:not(.builder.expert-mode) .zoom-toast {
  background: #fff;
  color: var(--finora-text);
  border-color: var(--finora-border);
  box-shadow: 0 4px 12px rgba(15,23,42,.10);
}
