.workspace.chatbots-mode { display:block; --panel:var(--surface); --border:var(--line); }
.workspace.chatbots-mode :is(.sidebar,.dialogs-header,.chat-panel) {display:none;}
.workspace.chatbots-mode #chatbots-panel {display:grid;}
#chatbots-content {padding:20px; min-width:0;}
.chatbots-toolbar {display:flex;gap:12px;align-items:center;flex-wrap:wrap;position:sticky;top:0;z-index:6;padding:8px 0;background:var(--surface);border-bottom:1px solid var(--line);}
.chatbots-toolbar select {flex:1;min-width:180px;max-width:600px;height:44px;font:inherit;}
.chatbots-toolbar :is(button,select),.chatbots-toolbar .primary-button {min-height:44px;margin:0;width:auto;font-size:15px;}
.chatbots-status {margin:12px 0;color:var(--muted);}
.chatbot-editor-surface {border:0;padding:0;margin:0;min-width:0;}
.chatbot-global-settings {padding:10px 12px;margin-bottom:14px;border:1px solid var(--line);border-radius:12px;}
.chatbot-global-settings > summary {cursor:pointer;font-size:14px;font-weight:600;}
.chatbot-global-settings[open] > :not(summary) {margin-top:14px;}
.chatbot-global-settings select {height:44px;font:inherit;background:var(--surface);color:var(--text);border:1px solid var(--line);border-radius:10px;max-width:100%;}
.chatbot-flow-host .vk-flow-field select {height:44px;}
.chatbot-editor-surface .vk-flow {min-width:0;}
.chatbot-editor-surface .vk-flow-toolbar {align-items:flex-end;}
.chatbot-editor-surface .vk-flow-toolbar > label {flex:1;min-width:180px;}
.chatbot-editor-surface input:not([type=checkbox]),.chatbots-toolbar select {padding:10px;border:1px solid var(--border);border-radius:10px;background:var(--panel);color:var(--text);}
.chatbot-editor-surface .checkbox-row {align-self:center;}
.bot-designer {display:grid;grid-template-columns:minmax(0,1.5fr) minmax(340px,1fr);align-items:start;gap:16px;min-width:0;}
.bot-graph {min-width:0;position:sticky;top:74px;border:1px solid var(--border);border-radius:14px;overflow:hidden;background:var(--panel);}
.bot-graph-toolbar {display:flex;gap:6px;padding:10px;align-items:center;flex-wrap:wrap;}
.bot-graph-toolbar input {width:160px;min-width:0;flex:1;}
.bot-graph-toolbar button {margin:0!important;min-height:36px;padding:6px 10px;font-size:13px;}
.bot-graph-toolbar .muted {font-size:12px;flex-basis:100%;}
.bot-graph-zoom {font-size:12px;min-width:34px;}
.bot-graph-hint {font-size:12px;padding:0 10px;margin:4px 0 10px;color:var(--muted);min-height:32px;}
.bot-graph-viewport {height:clamp(340px,58vh,720px);overflow:auto;overscroll-behavior:contain;background-color:var(--bg);background-image:radial-gradient(var(--border) 1px,transparent 1px);background-size:18px 18px;}
.bot-graph-frame {position:relative;}
.bot-graph-world {position:relative;transform-origin:top left;}
.bot-graph-edges {position:absolute;inset:0;pointer-events:none;overflow:visible;}
.bot-graph-edges path {fill:none;stroke:var(--muted);stroke-width:1.5;opacity:.45;}
.bot-graph-edges path.selected {stroke:var(--accent);stroke-width:2.5;opacity:1;}
.bot-node {position:absolute;width:280px;padding:0 0 8px;border:1px solid var(--border);border-radius:12px;background:var(--panel);box-shadow:0 4px 12px #0001;color:var(--text);}
.bot-node.selected {outline:2px solid var(--accent);}
.bot-node.archived {border-style:dashed;}
.bot-node.search-muted {opacity:.35;}
.bot-node-head {height:44px;display:flex;align-items:center;border-bottom:1px solid var(--border);}
.bot-node-head button {margin:0;border:0;background:none;color:inherit;min-height:36px;padding:4px;font:inherit;}
.bot-node-title {flex:1;min-width:0;text-align:left;font-weight:700!important;overflow:hidden;text-overflow:ellipsis;white-space:nowrap;}
.bot-node-inlet {width:26px;color:var(--accent)!important;}
.is-linking .bot-node-inlet {outline:2px solid var(--accent);border-radius:50%;cursor:crosshair;}
.bot-node-drag {width:30px;cursor:grab;touch-action:none;font-size:22px!important;}
.bot-node-meta {display:block;margin:4px 12px;height:16px;font-size:11px;color:var(--accent);}
.bot-node-excerpt {margin:4px 12px;height:20px;overflow:hidden;white-space:nowrap;text-overflow:ellipsis;font-size:12px;color:var(--muted);}
.bot-node-button {display:flex;height:32px;align-items:center;border-top:1px solid var(--border);padding-left:12px;font-size:13px;gap:6px;}
.bot-node-button span {flex:1;overflow:hidden;text-overflow:ellipsis;white-space:nowrap;}
.bot-node-port {margin:0;border:0;background:none;color:var(--accent);width:32px;height:30px;cursor:crosshair;font-size:18px;}
.bot-inspector {min-width:0;display:grid;gap:12px;}
.bot-inspector > h3 {margin:0;overflow-wrap:anywhere;}
.bot-inspector > details {min-width:0;}
.bot-inspector > details > summary {display:none;}
.bot-inspector .vk-flow-grid {grid-template-columns:minmax(0,1fr);}
.bot-inspector button {white-space:normal;}
.bot-inspector [aria-pressed=true] {border-color:var(--accent);color:var(--accent);}
.bot-checks {display:flex;flex-wrap:wrap;gap:6px;max-height:140px;overflow:auto;padding:10px 12px;border:1px solid var(--border);border-radius:12px;font-size:13px;}
.bot-checks > strong {flex-basis:100%;}
.bot-checks button {margin:0;padding:4px 8px;min-height:32px;font-size:12px;text-align:left;white-space:normal;}
.bot-check-error {color:#bc4c39!important;}
.bot-check-warning {color:var(--muted);}
@media(max-width:1050px) {
  .bot-designer {grid-template-columns:minmax(0,1fr);}
  .bot-graph {position:static;}
  .bot-graph-viewport {height:380px;}
}
@media(max-width:600px) {
  #chatbots-content {padding:12px;}
  .chatbots-toolbar select {flex-basis:100%;max-width:none;}
  .chatbots-toolbar button {flex:1;}
  .chatbot-editor-surface > .vk-flow-grid {grid-template-columns:minmax(0,1fr);}
  .bot-graph-viewport {height:340px;}
  .bot-node-head button {min-height:40px;}
}
