:root{
  --bg: #0b1020;
  --panel: rgba(255,255,255,0.06);
  --panel2: rgba(255,255,255,0.08);
  --border: rgba(255,255,255,0.10);
  --text: rgba(255,255,255,0.92);
  --muted: rgba(255,255,255,0.65);
  --muted2: rgba(255,255,255,0.45);
  --brand: #7c3aed;
  --brand2: #22c55e;
  --warn: #f59e0b;
  --danger: #ef4444;
  --shadow: 0 18px 60px rgba(0,0,0,0.45);
  --radius: 16px;
  --radius2: 12px;
  --mono: ui-monospace, SFMono-Regular, Menlo, Monaco, Consolas, "Liberation Mono", "Courier New", monospace;
  --sans: ui-sans-serif, system-ui, -apple-system, Segoe UI, Roboto, Inter, Arial, "Noto Sans", "Apple Color Emoji", "Segoe UI Emoji";
  --sidebar-width: 270px;
  --chat-width: 380px;
}

*{ box-sizing: border-box; }
html, body{ height: 100%; }
body{
  margin: 0;
  font-family: var(--sans);
  color: var(--text);
  background:
    radial-gradient(1200px 800px at 15% 10%, rgba(124,58,237,0.22), transparent 60%),
    radial-gradient(900px 700px at 85% 30%, rgba(34,197,94,0.14), transparent 65%),
    radial-gradient(700px 550px at 45% 90%, rgba(59,130,246,0.12), transparent 65%),
    var(--bg);
}

.modalOverlay{
  position: fixed;
  inset: 0;
  background: #050712; /* непрозрачный фон */
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 24px;
  z-index: 9999;
}
.modalBox{
  width: min(760px, 100%);
  max-height: 85vh;
  overflow: hidden;
  border-radius: var(--radius);
  border: 1px solid rgba(255,255,255,0.12);
  /* непрозрачная "карта" модалки */
  background: #0b1020;
  box-shadow: 0 30px 90px rgba(0,0,0,0.7);
}
.modalBox .cardHeader,
.modalBox .cardBody{
  background: transparent;
}

a{ color: inherit; text-decoration: none; }
button, input, select, textarea{ font-family: inherit; }

.app{
  height: 100vh;
  min-height: 0;
  display: grid;
  grid-template-columns: minmax(220px, min(var(--sidebar-width), 520px)) 8px 1fr;
}

.sidebar{
  padding: 18px 14px;
  border-right: none;
  background: rgba(0,0,0,0.25);
  backdrop-filter: blur(14px);
  height: 100vh;
  overflow: auto;
}

.vResizer{
  width: 8px;
  cursor: col-resize;
  background: rgba(255,255,255,0.03);
  border-left: 1px solid rgba(255,255,255,0.06);
  border-right: 1px solid rgba(255,255,255,0.06);
}
.vResizer:hover{
  background: rgba(124,58,237,0.12);
  border-left-color: rgba(124,58,237,0.28);
  border-right-color: rgba(124,58,237,0.28);
}
body.isResizing{
  cursor: col-resize;
  user-select: none;
}
.brand{
  display:flex;
  align-items:center;
  gap:10px;
  padding: 10px 10px 14px 10px;
}
.logo{
  width: 34px; height: 34px;
  border-radius: 12px;
  background: linear-gradient(135deg, rgba(124,58,237,1), rgba(34,197,94,0.9));
  box-shadow: 0 14px 28px rgba(124,58,237,0.25);
}
.brand h1{
  font-size: 14px;
  margin: 0;
  letter-spacing: 0.2px;
}
.brand .sub{
  font-size: 12px;
  color: var(--muted);
}

.nav{
  display:flex;
  flex-direction: column;
  gap: 6px;
  padding: 10px;
}
.nav a{
  display:flex;
  align-items:center;
  justify-content: space-between;
  padding: 10px 10px;
  border-radius: 12px;
  border: 1px solid transparent;
  color: var(--muted);
}
.nav a:hover{
  color: var(--text);
  background: rgba(255,255,255,0.05);
  border-color: rgba(255,255,255,0.06);
}
.nav a.active{
  color: var(--text);
  background: linear-gradient(180deg, rgba(124,58,237,0.16), rgba(255,255,255,0.03));
  border-color: rgba(124,58,237,0.25);
}
.pill{
  font-size: 11px;
  color: rgba(255,255,255,0.75);
  border: 1px solid rgba(255,255,255,0.16);
  padding: 2px 8px;
  border-radius: 999px;
  background: rgba(0,0,0,0.18);
}
.pill.ok{ border-color: rgba(34,197,94,0.35); color: rgba(34,197,94,0.95); }
.pill.warn{ border-color: rgba(245,158,11,0.35); color: rgba(245,158,11,0.95); }
.pill.bad{ border-color: rgba(239,68,68,0.35); color: rgba(239,68,68,0.95); }

.sidebarFooter{
  margin-top: 14px;
  padding: 12px 10px;
  border-top: 1px solid rgba(255,255,255,0.06);
  color: var(--muted2);
  font-size: 12px;
}

.sideSection{
  padding: 10px;
  display:flex;
  flex-direction: column;
  gap: 8px;
}
.sideSection + .sideSection{
  border-top: 1px solid rgba(255,255,255,0.06);
}
.sideSectionHeader{
  display:flex;
  align-items:center;
  justify-content: space-between;
  gap: 10px;
}
.sideSectionTitle{
  font-size: 12px;
  font-weight: 700;
  color: rgba(255,255,255,0.86);
}
.iconBtns{
  display:flex;
  align-items:center;
  gap: 6px;
}
.iconBtn{
  width: 28px;
  height: 28px;
  display:inline-flex;
  align-items:center;
  justify-content:center;
  border-radius: 10px;
  border: 1px solid rgba(255,255,255,0.10);
  background: rgba(0,0,0,0.18);
  color: rgba(255,255,255,0.78);
  cursor: pointer;
}
.iconBtn:hover{
  background: rgba(255,255,255,0.06);
  border-color: rgba(255,255,255,0.18);
  color: rgba(255,255,255,0.92);
}
.sideItem{
  border: 1px solid rgba(255,255,255,0.08);
  background: rgba(0,0,0,0.14);
  border-radius: 12px;
  padding: 10px 10px;
}
.sideItemTitle{
  font-size: 12px;
  font-weight: 650;
  margin: 0;
}
.sideItemSub{
  margin: 6px 0 0 0;
  font-size: 12px;
  color: var(--muted2);
  line-height: 1.35;
}
.loreDesc{
  text-align: right;
}
.sideList{
  display:flex;
  flex-direction: column;
  gap: 6px;
}
.tabLink{
  display:flex;
  align-items:center;
  justify-content: space-between;
  padding: 10px 10px;
  border-radius: 12px;
  border: 1px solid transparent;
  color: var(--muted);
}
.tabLink:hover{
  color: var(--text);
  background: rgba(255,255,255,0.05);
  border-color: rgba(255,255,255,0.06);
}
.tabLink.active{
  color: var(--text);
  background: linear-gradient(180deg, rgba(124,58,237,0.16), rgba(255,255,255,0.03));
  border-color: rgba(124,58,237,0.25);
}

.main{
  display:flex;
  flex-direction: column;
  min-width: 0;
  min-height: 0;
}

.topbar{
  display:flex;
  gap: 12px;
  align-items:center;
  justify-content: space-between;
  padding: 14px 18px;
  border-bottom: 1px solid var(--border);
  background: rgba(0,0,0,0.18);
  backdrop-filter: blur(14px);
}
.topbarLeft{
  display:flex;
  align-items:center;
  gap: 10px;
  min-width: 0;
}
.title{
  font-size: 14px;
  font-weight: 650;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
.breadcrumbs{
  font-size: 12px;
  color: var(--muted);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
.topbarRight{
  display:flex;
  align-items:center;
  gap: 10px;
}
.topbarRight .row{
  flex-wrap: nowrap;
}
.topbarRight .pill{
  white-space: nowrap;
}

.container{
  padding: 12px;
  min-width: 0;
  flex: 1;
  min-height: 0;
  overflow: auto;
}

.grid{
  display:grid;
  gap: 12px;
}
.grid.cols2{ grid-template-columns: 1fr 1fr; }
.grid.cols3{ grid-template-columns: 1fr 1fr 1fr; }

.card{
  border: 1px solid var(--border);
  background: linear-gradient(180deg, rgba(255,255,255,0.06), rgba(255,255,255,0.03));
  border-radius: var(--radius);
  box-shadow: var(--shadow);
}
.cardHeader{
  padding: 14px 14px 10px 14px;
  border-bottom: 1px solid rgba(255,255,255,0.06);
  display:flex;
  align-items:center;
  justify-content: space-between;
  gap: 10px;
}
.cardTitle{
  margin: 0;
  font-size: 13px;
  font-weight: 650;
}
.cardSub{
  margin: 0;
  font-size: 12px;
  color: var(--muted);
}
.cardBody{
  padding: 14px;
}

.row{
  display:flex;
  gap: 10px;
  align-items:center;
}
.row.wrap{ flex-wrap: wrap; }
.row.between{ justify-content: space-between; }
.spacer{ flex: 1; }

.btn{
  display:inline-flex;
  align-items:center;
  gap: 8px;
  border-radius: 12px;
  padding: 10px 12px;
  border: 1px solid rgba(255,255,255,0.12);
  background: rgba(0,0,0,0.18);
  color: rgba(255,255,255,0.92);
  cursor: pointer;
  transition: transform .06s ease, background .12s ease, border-color .12s ease;
  user-select: none;
}
.btn:hover{ background: rgba(255,255,255,0.06); border-color: rgba(255,255,255,0.18); }
.btn:active{ transform: translateY(1px); }
.btn.primary{
  background: linear-gradient(135deg, rgba(124,58,237,0.95), rgba(124,58,237,0.6));
  border-color: rgba(124,58,237,0.45);
}
.btn.primary:hover{ border-color: rgba(124,58,237,0.65); }
.btn.success{
  background: linear-gradient(135deg, rgba(34,197,94,0.95), rgba(34,197,94,0.55));
  border-color: rgba(34,197,94,0.45);
}
.btn.ghost{
  background: transparent;
}
.btn.danger{
  background: linear-gradient(135deg, rgba(239,68,68,0.95), rgba(239,68,68,0.55));
  border-color: rgba(239,68,68,0.45);
}

.kbd{
  font-family: var(--mono);
  font-size: 11px;
  padding: 2px 8px;
  border-radius: 999px;
  border: 1px solid rgba(255,255,255,0.16);
  background: rgba(0,0,0,0.22);
  color: rgba(255,255,255,0.75);
}

.input, .select, .textarea{
  width: 100%;
  padding: 10px 12px;
  border-radius: 12px;
  border: 1px solid rgba(255,255,255,0.12);
  background: rgba(0,0,0,0.22);
  color: rgba(255,255,255,0.90);
  outline: none;
}
.select{
  appearance: none;
  color: rgba(255,255,255,0.92) !important;
  background-image:
    linear-gradient(45deg, transparent 50%, rgba(255,255,255,0.55) 50%),
    linear-gradient(135deg, rgba(255,255,255,0.55) 50%, transparent 50%);
  background-position:
    calc(100% - 18px) 50%,
    calc(100% - 12px) 50%;
  background-size: 6px 6px, 6px 6px;
  background-repeat: no-repeat;
  padding-right: 30px;
}
.select option{
  color: #0b1020;
  background: #ffffff;
}
.checkboxRow{
  display:flex;
  flex-direction: column;
  gap: 8px;
}
.checkbox{
  display:flex;
  gap: 10px;
  align-items:flex-start;
  padding: 10px 10px;
  border-radius: 12px;
  border: 1px solid rgba(255,255,255,0.10);
  background: rgba(0,0,0,0.14);
}
.checkbox input{ margin-top: 3px; }
.checkboxTitle{
  font-size: 12px;
  font-weight: 700;
}
.checkboxSub{
  font-size: 12px;
  color: rgba(255,255,255,0.52);
  margin-top: 4px;
  line-height: 1.35;
}

.colorWheel{
  display:flex;
  flex-direction: column;
  gap: 10px;
}
.colorWheelCanvas{
  width: 190px;
  height: 190px;
  border-radius: 999px;
  border: 1px solid rgba(255,255,255,0.14);
  background: rgba(0,0,0,0.16);
  box-shadow: 0 18px 50px rgba(0,0,0,0.45);
  touch-action: none;
}
.colorWheelRow{
  display:flex;
  gap: 10px;
  align-items:center;
}
.colorSwatch{
  width: 38px;
  height: 38px;
  border-radius: 14px;
  border: 1px solid rgba(255,255,255,0.14);
  box-shadow: 0 18px 50px rgba(0,0,0,0.35);
}

.centerTextView{
  display:flex;
  flex-direction: column;
  flex: 1;
  min-height: 0;
}
.textPane{
  display:flex;
  flex-direction: column;
  flex: 1;
  min-height: 0;
}
.textAreaWrap{
  position: relative;
  flex: 1;
  min-height: 0;
}
.centerTextView .textarea{
  flex: 1;
  min-height: 0;
  height: 100%;
  padding-right: 52px; /* место под вертикальную колонку кнопок */
}
.textToolsBar{
  position: absolute;
  top: 10px;
  right: 10px;
  display:flex;
  flex-direction: column;
  gap: 8px;
  pointer-events: none; /* не блокируем выделение текста */
}
.textToolBtn{
  width: 28px;
  height: 28px;
  border-radius: 10px;
  border: 1px solid rgba(255,255,255,0.10);
  background: rgba(0,0,0,0.18);
  color: rgba(255,255,255,0.78);
  cursor: pointer;
  display:inline-flex;
  align-items:center;
  justify-content:center;
  font-size: 16px;
  line-height: 1;
  font-weight: 750;
  pointer-events: auto; /* сами кнопки кликабельны */
}
.textToolBtn:hover{
  background: rgba(255,255,255,0.06);
  border-color: rgba(255,255,255,0.18);
  color: rgba(255,255,255,0.92);
}
.textToolBtn:disabled{
  opacity: 0.55;
  cursor: not-allowed;
}
/* back-compat классы: оставляем только для семантики, стили задаёт .textToolBtn */
.textFindBtn{ outline: none; }
.textUndoBtn{ outline: none; }
.textClearBtn{ outline: none; }
.textStats{
  padding: 8px 12px 10px 12px;
  border-top: 1px solid rgba(255,255,255,0.06);
  font-size: 12px;
  color: rgba(255,255,255,0.60);
  background: rgba(0,0,0,0.08);
  user-select: none;
}

.ctxMenu{
  position: fixed;
  z-index: 10000;
  min-width: 180px;
  border-radius: 14px;
  border: 1px solid rgba(255,255,255,0.12);
  background: #0b1020;
  box-shadow: 0 30px 90px rgba(0,0,0,0.7);
  padding: 6px;
}
.ctxItem{
  width: 100%;
  text-align: left;
  border-radius: 12px;
  border: 1px solid transparent;
  background: transparent;
  color: rgba(255,255,255,0.88);
  padding: 10px 10px;
  cursor: pointer;
}
.ctxItem:hover{
  background: rgba(255,255,255,0.06);
  border-color: rgba(255,255,255,0.10);
}
.textarea{ min-height: 120px; resize: vertical; }
.fieldLabel{
  font-size: 12px;
  color: var(--muted);
  margin: 0 0 6px 0;
}

.table{
  width: 100%;
  border-collapse: collapse;
}
.table th, .table td{
  text-align: left;
  padding: 10px 10px;
  border-bottom: 1px solid rgba(255,255,255,0.06);
  font-size: 12px;
  color: rgba(255,255,255,0.88);
}
.table th{ color: var(--muted); font-weight: 650; }
.table tr:hover td{ background: rgba(255,255,255,0.03); }

.editorLayout{
  display:grid;
  grid-template-columns: minmax(0, 1fr) 8px minmax(280px, min(var(--chat-width), 640px));
  row-gap: 12px;
  column-gap: 0px;
  height: 100%;
  min-height: 0;
}
.editorLayout > .panel{
  margin: 0 12px;
}
.editorLayout > .vResizer{
  margin: 0;
}
.editorLayout > .panel:first-child{ margin-left: 0; }
.editorLayout > .panel:last-child{ margin-right: 0; }
.panel{
  border: 1px solid var(--border);
  background: linear-gradient(180deg, rgba(255,255,255,0.06), rgba(255,255,255,0.03));
  border-radius: var(--radius);
  box-shadow: var(--shadow);
  overflow: hidden;
  min-width: 0;
}
.panelFill{
  height: 100%;
  display: flex;
  flex-direction: column;
  min-height: 520px;
}
.panelFill .panelBody{
  flex: 1;
  min-height: 0;
}
.panelFill .canvas{
  flex: 1;
  min-height: 0;
}
.panelHeader{
  padding: 12px 12px;
  border-bottom: 1px solid rgba(255,255,255,0.06);
  display:flex;
  align-items:center;
  justify-content: space-between;
  gap: 10px;
}
.panelTitle{
  font-size: 12px;
  color: rgba(255,255,255,0.85);
  font-weight: 650;
}
.panelBody{
  padding: 12px;
}
.tabs{
  display:flex;
  gap: 6px;
  align-items:center;
}
.tabsBar{
  display:flex;
  align-items:center;
  gap: 8px;
  min-width: 0;
  flex: 1;
}
.tabsScroll{
  display:flex;
  align-items:center;
  gap: 6px;
  overflow-x: auto;
  overflow-y: hidden;
  white-space: nowrap;
  flex: 1;
  min-width: 0;
  padding-bottom: 2px;
  scrollbar-width: thin;
  scrollbar-color: rgba(255,255,255,0.18) transparent;
}
.tabsScroll::-webkit-scrollbar{ height: 10px; }
.tabsScroll::-webkit-scrollbar-track{ background: transparent; }
.tabsScroll::-webkit-scrollbar-thumb{
  background: rgba(255,255,255,0.14);
  border: 2px solid transparent;
  background-clip: padding-box;
  border-radius: 999px;
}
.tabsPlus{
  flex: 0 0 auto;
}
.tabsLabel{
  font-size: 12px;
  font-weight: 650;
  color: rgba(255,255,255,0.68);
  margin-right: 6px;
}
.tab{
  font-size: 12px;
  padding: 9px 12px;
  border-radius: 12px;
  border: 1px solid rgba(255,255,255,0.14);
  background: rgba(0,0,0,0.20);
  color: rgba(255,255,255,0.78);
  cursor: pointer;
  user-select: none;
  line-height: 1;
  flex: 0 0 auto;
}
.tab.dragging{
  opacity: 0.55;
}
.tab.dropTarget{
  outline: 2px solid rgba(124,58,237,0.45);
  outline-offset: 2px;
}
.tab:active{ transform: translateY(1px); }
.tab.active{
  color: rgba(255,255,255,0.92);
  border-color: rgba(124,58,237,0.55);
  background: linear-gradient(180deg, rgba(124,58,237,0.26), rgba(255,255,255,0.03));
  box-shadow: 0 10px 30px rgba(124,58,237,0.18);
}
.tabDot{
  display:inline-block;
  width: 7px;
  height: 7px;
  border-radius: 999px;
  margin-right: 8px;
  background: rgba(124,58,237,0.7);
  border: 1px solid rgba(124,58,237,0.35);
}
.canvas{
  height: 100%;
  min-height: 520px;
  background:
    radial-gradient(circle at 1px 1px, rgba(255,255,255,0.08) 1px, transparent 0) 0 0 / 18px 18px,
    rgba(0,0,0,0.20);
  position: relative;
  overflow: auto;
  border-radius: 0 0 var(--radius) var(--radius);
}
.canvasInner{
  position: relative;
  min-height: 900px;
  min-width: 900px;
  padding-top: 0;
}
.nodeSideBar{
  position: absolute;
  top: 12px;
  left: 12px;
  z-index: 7;
  width: 54px;
  display:flex;
  flex-direction: column;
  gap: 8px;
  padding: 10px 8px;
  margin: 0;
  border-radius: 18px;
  border: 1px solid rgba(255,255,255,0.10);
  background: rgba(0,0,0,0.22);
  backdrop-filter: blur(10px);
  box-shadow: 0 18px 60px rgba(0,0,0,0.35);
  pointer-events: none; /* не блокируем перемещение/клики по нодам под сайдбаром */
}
.nodeSideBar .iconBtn{
  width: 38px;
  height: 38px;
  border-radius: 14px;
  pointer-events: auto; /* кнопки кликабельны */
}
.nodeZoomBar{
  position: absolute;
  top: 0;
  left: 0;
  z-index: 7;
  height: 46px;
  display:flex;
  align-items:center;
  gap: 8px;
  padding: 8px 10px;
  border-radius: 16px;
  border: 1px solid rgba(255,255,255,0.10);
  background: rgba(0,0,0,0.22);
  backdrop-filter: blur(10px);
  box-shadow: 0 18px 60px rgba(0,0,0,0.35);
  pointer-events: none; /* не блокируем поле нод, только кнопки */
}
.nodeZoomBar .iconBtn{
  width: 38px;
  height: 38px;
  border-radius: 14px;
  pointer-events: auto;
}
.nodeZoomPct{
  min-width: 46px;
  text-align: center;
  font-size: 12px;
  font-weight: 750;
  color: rgba(255,255,255,0.78);
  user-select: none;
  pointer-events: none;
}
.nodeSideSep{
  height: 1px;
  margin: 2px 4px;
  background: rgba(255,255,255,0.10);
}
.nodeSideDot{
  width: 100%;
  text-align: center;
  font-size: 16px;
  line-height: 1;
  color: rgba(255,255,255,0.32);
  user-select: none;
}
.nodeSideDot.dirty{ color: rgba(245,158,11,0.95); }
.edgesLayer{
  position: absolute;
  inset: 0;
  pointer-events: auto;
}
.edgePath{
  fill: none;
  stroke: rgba(124,58,237,0.55);
  stroke-width: 2.5;
  pointer-events: none; /* клики ловит отдельный hit-path */
}
.edgePath.active{
  stroke: rgba(245,158,11,0.95);
  stroke-width: 3.5;
}
.edgeHit{
  fill: none;
  stroke: transparent;
  stroke-width: 14;
  pointer-events: stroke;
  cursor: pointer;
}
.edgePath.preview{
  stroke: rgba(124,58,237,0.85);
  stroke-dasharray: 6 6;
}
.nodeToolsTray{
  position: static;
  width: 220px;
  height: 48px;
  border-radius: 14px;
  border: 1px solid rgba(255,255,255,0.12);
  background: rgba(0,0,0,0.20);
  backdrop-filter: blur(10px);
  box-shadow: 0 18px 60px rgba(0,0,0,0.45);
  display:flex;
  align-items:center;
  gap: 8px;
  padding: 8px;
}
.nodeRunTray{
  display:flex;
  gap: 8px;
  align-items:center;
  flex-wrap: wrap;
  justify-content: flex-end;
}
.nodeRunTray .btn{
  padding: 8px 10px;
  border-radius: 12px;
  font-size: 12px;
}
.runPlayBtn{
  width: 44px;
  height: 44px;
  border-radius: 999px;
  border-color: rgba(124,58,237,0.45);
  background: linear-gradient(135deg, rgba(124,58,237,0.95), rgba(124,58,237,0.55));
  color: rgba(255,255,255,0.95);
}
.runPlayBtn:hover{
  border-color: rgba(124,58,237,0.65);
}
.node{
  position: absolute;
  width: 420px;
  min-width: 320px;
  min-height: 180px;
  border-radius: 14px;
  border: 1px solid rgba(255,255,255,0.12);
  background: rgba(0,0,0,0.25);
  box-shadow: 0 20px 60px rgba(0,0,0,0.5);
  overflow: hidden;
}
.nodeInteractive{
  cursor: pointer;
}
.nodeInteractive.active{
  border-color: rgba(124,58,237,0.55);
  box-shadow: 0 22px 70px rgba(124,58,237,0.22);
}
.nodeInteractive.running{
  border-color: rgba(249,115,22,0.80);
  box-shadow: 0 22px 70px rgba(249,115,22,0.22);
}
.nodeRange{
  width: 140px;
  max-width: 140px;
  height: 28px;
}
.nodeHeader{
  padding: 10px 10px 8px 10px;
  border-bottom: 1px solid rgba(255,255,255,0.06);
  display:flex;
  justify-content: space-between;
  align-items:center;
}
.nodeDragHandle{
  cursor: grab;
  user-select: none;
}
.nodeDragHandle:active{
  cursor: grabbing;
}
.nodeTitle{
  font-size: 12px;
  font-weight: 700;
}
.nodeBody{
  padding: 10px;
  color: var(--muted);
  font-size: 12px;
  min-width: 0;
}
.nodeBody .select,
.nodeBody .input{
  max-width: 100%;
}
.nodeResizeHandle{
  position: absolute;
  right: 8px;
  bottom: 8px;
  width: 14px;
  height: 14px;
  border-radius: 4px;
  border: 1px solid rgba(255,255,255,0.16);
  background:
    linear-gradient(135deg, rgba(255,255,255,0.00) 45%, rgba(255,255,255,0.28) 46%, rgba(255,255,255,0.28) 55%, rgba(255,255,255,0.00) 56%),
    rgba(0,0,0,0.22);
  cursor: nwse-resize;
}
.nodeTempNum{
  width: 80px;
}
.nodePort{
  position: absolute;
  top: 50%;
  width: 14px;
  height: 14px;
  border-radius: 999px;
  transform: translateY(-50%);
  border: 1px solid rgba(255,255,255,0.22);
  background: rgba(0,0,0,0.25);
  box-shadow: 0 10px 30px rgba(0,0,0,0.4);
}
.nodePort.in{
  left: -8px;
  background: rgba(34,197,94,0.32);
  border-color: rgba(34,197,94,0.55);
}
.nodePort.out{
  right: -8px;
  background: rgba(124,58,237,0.32);
  border-color: rgba(124,58,237,0.55);
}
.nodePort.out.outA{ top: 38%; }
.nodePort.out.outB{ top: 62%; }
.nodePort.out.outB{
  background: rgba(59,130,246,0.30);
  border-color: rgba(59,130,246,0.55);
}
.nodePort.out.loopPort{
  top: 38%;
  background: rgba(59,130,246,0.30);
  border-color: rgba(59,130,246,0.55);
}
.nodePort.out.nextPort{ top: 62%; }
.nodePort:hover{
  filter: brightness(1.15);
}
.portRow{
  display:flex;
  justify-content: space-between;
  gap: 10px;
  margin-top: 10px;
}
.port{
  display:flex;
  align-items:center;
  gap: 8px;
  color: rgba(255,255,255,0.75);
}
.dot{
  width: 10px;
  height: 10px;
  border-radius: 999px;
  background: rgba(255,255,255,0.24);
  border: 1px solid rgba(255,255,255,0.20);
}
.dot.in{ background: rgba(34,197,94,0.35); border-color: rgba(34,197,94,0.45); }
.dot.out{ background: rgba(124,58,237,0.35); border-color: rgba(124,58,237,0.45); }

.chatWrap{
  display:flex;
  flex-direction: column;
  height: 100%;
  min-height: 0;
}

.authCenter{
  min-height: 100vh;
  display:flex;
  align-items:center;
  justify-content:center;
  padding: 18px;
}
.authCenter > .card{
  width: 420px;
  max-width: calc(100vw - 36px);
}
.chatMessages{
  padding: 12px;
  display:flex;
  flex-direction: column;
  gap: 10px;
  overflow: auto;
  flex: 1;
  min-height: 0;
}
.chatMsg{
  position: relative;
  display:flex;
  flex-direction: column;
  gap: 6px;
  padding: 10px 10px;
  padding-right: 72px;
  border-radius: 14px;
  border: 1px solid rgba(255,255,255,0.08);
  background: rgba(0,0,0,0.10);
}
.chatMsgActions{
  position: absolute;
  top: 8px;
  right: 8px;
  display:flex;
  gap: 6px;
}
.chatMsgActionBtn{
  width: 28px;
  height: 28px;
  border-radius: 10px;
  border: 1px solid rgba(255,255,255,0.10);
  background: rgba(0,0,0,0.18);
  color: rgba(255,255,255,0.78);
  cursor: pointer;
}
.chatMsgActionBtn:hover{
  background: rgba(255,255,255,0.06);
  border-color: rgba(255,255,255,0.18);
  color: rgba(255,255,255,0.92);
}
.chatMsgRole{
  font-size: 11px;
  color: rgba(255,255,255,0.55);
  letter-spacing: 0.2px;
}
.chatMsgText{
  font-size: 13px;
  color: rgba(255,255,255,0.88);
  line-height: 1.4;
  white-space: pre-wrap;
}
.chatGreeting{
  margin-top: 6px;
  padding: 12px 12px;
  border-radius: 14px;
  border: 1px solid rgba(255,255,255,0.10);
  background: rgba(0,0,0,0.14);
  color: rgba(255,255,255,0.86);
  font-size: 13px;
  line-height: 1.35;
}
.bubble{
  max-width: 95%;
  border-radius: 14px;
  border: 1px solid rgba(255,255,255,0.10);
  background: rgba(0,0,0,0.18);
  padding: 10px 10px;
}
.bubble.me{
  margin-left: auto;
  border-color: rgba(124,58,237,0.22);
  background: rgba(124,58,237,0.10);
}
.bubble.ai{
  border-color: rgba(34,197,94,0.18);
  background: rgba(34,197,94,0.08);
}
.bubbleTitle{
  font-size: 12px;
  font-weight: 750;
  margin: 0 0 6px 0;
  color: rgba(255,255,255,0.88);
}
.bubbleText{
  margin: 0;
  font-size: 12px;
  line-height: 1.45;
  color: rgba(255,255,255,0.82);
  white-space: pre-wrap;
}
.chatComposer{
  border-top: 1px solid rgba(255,255,255,0.06);
  padding: 10px;
  display:flex;
  flex-direction: column;
  gap: 8px;
  background: rgba(0,0,0,0.14);
}
.chipRow{
  display:flex;
  gap: 6px;
  flex-wrap: wrap;
}
.chip{
  font-size: 11px;
  padding: 6px 10px;
  border-radius: 999px;
  border: 1px solid rgba(255,255,255,0.10);
  background: rgba(0,0,0,0.14);
  color: rgba(255,255,255,0.75);
}
.composerRow{
  display:flex;
  gap: 8px;
  align-items: flex-end;
}
.composerRow .textarea{
  min-height: 44px;
  height: 44px;
  resize: none;
}
.sendBtn{
  width: 44px;
  height: 44px;
  border-radius: 999px;
  border: 1px solid rgba(124,58,237,0.45);
  background: linear-gradient(135deg, rgba(124,58,237,0.95), rgba(124,58,237,0.55));
  color: rgba(255,255,255,0.95);
  display:flex;
  align-items:center;
  justify-content:center;
  cursor: pointer;
}
.sendBtn:hover{ border-color: rgba(124,58,237,0.65); }
.sendBtn:active{ transform: translateY(1px); }
.modelPicker{
  display:flex;
  flex-direction: column;
  gap: 6px;
}
.modelPicker .select{
  min-height: 44px;
}
.tempPicker{
  display:flex;
  flex-direction: column;
  gap: 6px;
}
.tempRow{
  display:flex;
  gap: 10px;
  align-items:center;
}
.tempRow .range{
  flex: 0 0 auto;
  width: 180px;
  max-width: 180px;
  height: 28px;
  accent-color: rgba(124,58,237,0.95);
}
.tempRow .range::-webkit-slider-runnable-track{
  height: 6px;
  border-radius: 999px;
  background: rgba(255,255,255,0.14);
}
.tempRow .range::-webkit-slider-thumb{
  -webkit-appearance: none;
  appearance: none;
  width: 16px;
  height: 16px;
  border-radius: 999px;
  border: 1px solid rgba(255,255,255,0.18);
  background: rgba(124,58,237,0.95);
  margin-top: -5px; /* центровка на треке 6px */
}
.tempRow .range::-moz-range-track{
  height: 6px;
  border-radius: 999px;
  background: rgba(255,255,255,0.14);
}
.tempRow .range::-moz-range-thumb{
  width: 16px;
  height: 16px;
  border-radius: 999px;
  border: 1px solid rgba(255,255,255,0.18);
  background: rgba(124,58,237,0.95);
}
.tempNum{
  width: 110px;
}
.smallHint{
  font-size: 11px;
  color: rgba(255,255,255,0.45);
}

.fakeChart{
  height: 140px;
  display:flex;
  align-items:flex-end;
  gap: 8px;
  padding: 12px;
  border-radius: 14px;
  border: 1px solid rgba(255,255,255,0.10);
  background: rgba(0,0,0,0.18);
}
.bar{
  width: 12px;
  border-radius: 8px 8px 4px 4px;
  background: linear-gradient(180deg, rgba(124,58,237,0.95), rgba(124,58,237,0.35));
  border: 1px solid rgba(124,58,237,0.25);
}
.bar.g{ background: linear-gradient(180deg, rgba(34,197,94,0.95), rgba(34,197,94,0.35)); border-color: rgba(34,197,94,0.25); }
.bar.y{ background: linear-gradient(180deg, rgba(245,158,11,0.95), rgba(245,158,11,0.35)); border-color: rgba(245,158,11,0.25); }

.muted{ color: var(--muted); }
.muted2{ color: var(--muted2); }

@media (max-width: 1200px){
  .editorLayout{ grid-template-columns: minmax(0, 1fr) 8px minmax(280px, 340px); }
}
@media (max-width: 900px){
  .app{ grid-template-columns: 1fr; }
  .sidebar{ display:none; }
  .editorLayout{ grid-template-columns: 1fr; }
  .vResizer{ display:none; }
  .editorLayout .chat{ display:none; }
  .editorLayout .vResizer[data-resize="chat"]{ display:none; }
}


