:root {
  --paper: #f5f3ed;
  --surface: #fffefa;
  --ink: #20242a;
  --muted: #6e737a;
  --line: #a8adb4;
  --soft-line: #d8d8d1;
  --accent: #5064d8;
  --accent-soft: #e8ebff;
  --note: #f1d36b;
  --success: #397a5a;
  --danger: #a14d47;
}

* { box-sizing: border-box; }
html, body, #root { width: 100%; height: 100%; margin: 0; }
body { background: var(--paper); color: var(--ink); font-family: "Microsoft YaHei", "PingFang SC", sans-serif; }
button, input, textarea { font: inherit; }

.screen {
  width: 1280px;
  height: 760px;
  background: var(--surface);
  display: grid;
  grid-template-columns: 190px 1fr;
  color: var(--ink);
  overflow: hidden;
}
.screen.compact-nav { grid-template-columns: 72px 1fr; }
.sidebar { border-right: 2px solid var(--ink); padding: 20px 14px; display: flex; flex-direction: column; gap: 8px; background: #f0eee7; }
.brand { display: flex; align-items: center; gap: 10px; font: 700 18px "Segoe Print", "KaiTi", cursive; padding: 3px 8px 20px; }
.brand-mark { width: 28px; height: 28px; border: 2px solid var(--ink); transform: rotate(-4deg); display: grid; place-items: center; background: var(--note); }
.nav-item { min-height: 42px; border: 1.5px solid transparent; background: transparent; color: var(--ink); display: flex; align-items: center; gap: 10px; padding: 0 10px; cursor: pointer; text-align: left; }
.nav-item.active { border-color: var(--ink); background: var(--surface); box-shadow: 3px 3px 0 var(--ink); }
.nav-item.new-task { border-color: var(--ink); background: var(--accent); color: #fff; box-shadow: 3px 3px 0 var(--ink); margin-bottom: 4px; }
.nav-item.new-task.selected { background: #3448be; box-shadow: 1px 1px 0 var(--ink); transform: translate(2px,2px); }
.task-group { min-height: 0; margin-top: 5px; padding-top: 10px; border-top: 1px solid var(--line); }
.task-heading { display: flex; align-items: center; justify-content: space-between; padding: 0 8px 7px; color: var(--muted); font-size: 11px; font-weight: 700; }
.task-heading span:last-child { min-width: 18px; height: 18px; padding: 0 5px; border: 1px solid var(--line); border-radius: 9px; display: grid; place-items: center; background: var(--surface); font-weight: 400; }
.new-task-form { border: 1.5px solid var(--ink); background: var(--surface); padding: 8px; margin-bottom: 8px; box-shadow: 2px 2px 0 var(--ink); }
.new-task-form textarea { width: 100%; min-height: 58px; resize: none; border: 1px solid var(--line); padding: 7px; background: #fff; color: var(--ink); font-size: 11px; outline: none; }
.new-task-form textarea:focus { border-color: var(--accent); }
.new-task-form > div { display: flex; justify-content: flex-end; gap: 5px; margin-top: 6px; }
.new-task-form button { min-height: 25px; border: 1px solid var(--line); background: #fff; padding: 0 7px; font-size: 10px; cursor: pointer; }
.new-task-form button.confirm { border-color: var(--ink); background: var(--accent); color: #fff; }
.new-task-form button:disabled { cursor: not-allowed; opacity: .45; }
.task-list { max-height: 105px; overflow-y: auto; display: flex; flex-direction: column; gap: 3px; padding-right: 2px; }
.task-item { width: 100%; min-height: 31px; border: 1px solid transparent; background: transparent; color: var(--ink); display: flex; align-items: center; gap: 7px; padding: 0 7px; cursor: pointer; text-align: left; font-size: 11px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.task-item > span { width: 6px; height: 6px; flex: none; border: 1px solid var(--ink); background: transparent; transform: rotate(45deg); }
.task-item.active { border-color: var(--accent); background: var(--accent-soft); color: #3448be; font-weight: 700; }
.task-item.active > span { border-color: var(--accent); background: var(--accent); }
.project-group { min-height: 0; margin-top: 4px; padding-top: 10px; border-top: 1px solid var(--line); }
.project-tab { width: 100%; min-height: 37px; border: 1.5px solid transparent; padding: 0 8px; display: flex; align-items: center; justify-content: space-between; background: transparent; color: var(--ink); cursor: pointer; }
.project-tab > span { display: flex; align-items: center; gap: 8px; font-size: 11px; font-weight: 700; }
.project-tab > b { min-width: 18px; height: 18px; padding: 0 5px; border: 1px solid var(--line); border-radius: 9px; display: grid; place-items: center; background: var(--surface); color: var(--muted); font-size: 9px; font-weight: 500; }
.project-tab.active { border-color: var(--ink); background: var(--surface); box-shadow: 2px 2px 0 var(--ink); }
.project-tab.space-tab { cursor: default; }
.project-run-list { max-height: 98px; margin-top: 5px; overflow-y: auto; display: flex; flex-direction: column; gap: 3px; }
.project-run-item { width: 100%; min-height: 31px; border: 1px solid transparent; padding: 0 6px; display: grid; grid-template-columns: 6px minmax(0,1fr) auto; align-items: center; gap: 6px; background: transparent; color: var(--ink); cursor: pointer; text-align: left; }
.project-run-item > i { width: 6px; height: 6px; border-radius: 50%; background: var(--accent); box-shadow: 0 0 0 3px rgba(80,100,216,.12); }
.project-run-item > span { overflow: hidden; font-size: 10px; white-space: nowrap; text-overflow: ellipsis; }
.project-run-item > small { color: var(--accent); font-size: 8px; }
.project-run-item:hover, .project-run-item.active { border-color: #bfc7ef; background: var(--accent-soft); }
.nav-spacer { flex: 1; }
.avatar { width: 32px; height: 32px; border: 1.5px solid var(--ink); border-radius: 50%; display: grid; place-items: center; background: #dfe6dd; font-size: 12px; }
.main { min-width: 0; display: flex; flex-direction: column; }
.topbar { height: 64px; flex: none; border-bottom: 1.5px solid var(--ink); padding: 0 24px; display: flex; align-items: center; gap: 12px; }
.topbar h1 { font: 700 18px "Segoe Print", "KaiTi", cursive; margin: 0; }
.topbar .grow { flex: 1; }
.crumb { color: var(--muted); font-size: 13px; }
.btn { border: 1.5px solid var(--ink); background: var(--surface); min-height: 34px; padding: 0 14px; cursor: pointer; box-shadow: 2px 2px 0 var(--ink); }
.btn.primary { background: var(--accent); color: #fff; }
.btn.ghost { border-color: var(--soft-line); box-shadow: none; color: var(--muted); }
.icon-btn { width: 34px; height: 34px; padding: 0; display: grid; place-items: center; border: 1.5px solid var(--ink); background: var(--surface); }
.content { flex: 1; min-height: 0; padding: 22px; overflow: hidden; }
.content.task-content { padding: 14px; background: #eef0f5; }
.agent-start-page { width: 100%; height: 100%; display: grid; place-items: center; background: radial-gradient(circle at 50% 43%, #f4f6ff 0, #fff 48%, #fbfbfd 100%); }
.agent-start-center { width: min(760px, calc(100% - 80px)); transform: translateY(-24px); }
.agent-start-title { margin-bottom: 24px; display: flex; align-items: center; justify-content: center; gap: 10px; }
.agent-start-title h2 { margin: 0; font: 700 26px "Microsoft YaHei", "PingFang SC", sans-serif; letter-spacing: -.6px; }
.agent-start-mark { width: 36px; height: 36px; border: 2px solid var(--ink); border-radius: 12px 12px 5px 12px; display: grid; place-items: center; background: var(--note); font: 800 15px "Segoe Print", cursive; transform: rotate(-4deg); }
.preview-badge { border: 1px solid #cbd2ff; border-radius: 10px; padding: 3px 7px; background: var(--accent-soft); color: var(--accent); font-size: 9px; font-weight: 700; }
.agent-start-tools { margin: 0 8px 9px; display: flex; align-items: center; gap: 18px; color: #49505c; font-size: 11px; }
.agent-start-tools span { display: flex; align-items: center; gap: 6px; }
.agent-start-composer { min-height: 132px; border: 1px solid #d7dae2; border-radius: 22px; padding: 15px 14px 10px; background: #fff; box-shadow: 0 12px 34px rgba(43,50,74,.12), 0 2px 7px rgba(43,50,74,.05); transition: border-color .2s ease, box-shadow .2s ease; }
.agent-start-composer:focus-within { border-color: #aeb8f3; box-shadow: 0 15px 38px rgba(63,78,172,.16), 0 0 0 3px rgba(80,100,216,.06); }
.agent-start-composer textarea { width: 100%; height: 72px; border: 0; resize: none; outline: none; background: transparent; color: var(--ink); font-size: 14px; line-height: 1.55; }
.agent-start-composer textarea::placeholder { color: #a0a5af; }
.agent-start-actions { display: flex; align-items: center; justify-content: space-between; }
.agent-start-actions > div { display: flex; align-items: center; gap: 7px; }
.agent-start-actions button { min-width: 30px; height: 30px; border: 0; border-radius: 15px; display: flex; align-items: center; justify-content: center; background: #f2f3f6; color: #646b76; cursor: pointer; }
.agent-start-actions button:hover { background: #e9ebf1; color: var(--ink); }
.agent-start-actions button.text-tool { width: auto; gap: 5px; padding: 0 10px; font-size: 10px; }
.agent-start-actions > div:last-child > span { color: #737a86; font-size: 10px; }
.agent-start-actions button.start-send { background: var(--accent); color: #fff; font-size: 19px; font-weight: 700; }
.agent-start-actions button.start-send:disabled { background: #bdc5ec; cursor: not-allowed; }
.agent-start-hint { margin: 12px 0 0; text-align: center; color: #9a9fa9; font-size: 9px; }
.title-row { display: flex; align-items: end; justify-content: space-between; margin-bottom: 18px; }
.title-row h2 { font: 700 26px "Segoe Print", "KaiTi", cursive; margin: 0 0 4px; }
.title-row p { margin: 0; color: var(--muted); font-size: 13px; }
.badge { display: inline-flex; align-items: center; gap: 6px; border: 1px solid var(--line); padding: 3px 8px; font-size: 12px; background: #fff; }
.status-dot { width: 7px; height: 7px; border-radius: 50%; background: var(--accent); }
.panel { border: 1.5px solid var(--ink); background: var(--surface); }
.panel-head { min-height: 44px; border-bottom: 1px solid var(--line); padding: 0 14px; display: flex; align-items: center; justify-content: space-between; font-weight: 700; }
.sketch-label { font: 700 13px "Segoe Print", "KaiTi", cursive; }
.muted { color: var(--muted); }
.small { font-size: 12px; }

.editor-grid { height: 100%; display: grid; grid-template-columns: 290px 1fr 260px; gap: 14px; }
.chat { display: flex; flex-direction: column; min-height: 0; }
.chat-body { flex: 1; padding: 14px; overflow: hidden; display: flex; flex-direction: column; gap: 12px; }
.bubble { border: 1px solid var(--line); padding: 10px 12px; line-height: 1.5; font-size: 12px; background: #fff; }
.bubble.user { margin-left: 34px; background: var(--accent-soft); border-color: var(--accent); }
.agent-chip { display: flex; align-items: center; gap: 8px; font-size: 12px; }
.agent-dot { width: 22px; height: 22px; border: 1.5px solid var(--ink); border-radius: 50%; display: grid; place-items: center; background: var(--note); font-weight: 700; }
.composer { margin: 0 12px 12px; border: 1.5px solid var(--ink); padding: 10px; min-height: 74px; display: flex; flex-direction: column; justify-content: space-between; color: var(--muted); font-size: 12px; }
.composer-actions { display: flex; justify-content: space-between; align-items: center; }

.workflow { min-width: 0; display: flex; flex-direction: column; }
.workflow-stage { flex: 1; padding: 16px 28px; overflow: hidden; background-image: radial-gradient(#c8c8c0 1px, transparent 1px); background-size: 18px 18px; }
.flow-card { width: 100%; min-height: 76px; border: 1.5px solid var(--ink); background: var(--surface); display: grid; grid-template-columns: 44px 1fr auto; gap: 12px; align-items: center; padding: 10px 12px; box-shadow: 3px 3px 0 #c8c8c0; position: relative; }
.flow-card.active { border-color: var(--accent); box-shadow: 3px 3px 0 var(--accent); }
.step-index { width: 32px; height: 32px; border: 1.5px solid var(--ink); display: grid; place-items: center; font: 700 13px "Segoe Print", cursive; background: #fff; }
.flow-card h4 { margin: 0 0 5px; font-size: 14px; }
.flow-card p { margin: 0; color: var(--muted); font-size: 11px; }
.flow-meta { display: flex; gap: 6px; margin-top: 7px; }
.flow-chip { border: 1px solid var(--line); padding: 2px 6px; font-size: 10px; background: #fff; }
.flow-rail { width: 2px; height: 19px; background: var(--accent); margin: 0 auto; position: relative; }
.flow-rail::after { content: ""; position: absolute; bottom: -1px; left: -3px; width: 6px; height: 6px; border-right: 2px solid var(--accent); border-bottom: 2px solid var(--accent); transform: rotate(45deg); }
.add-step { height: 32px; margin-top: 12px; border: 1.5px dashed var(--line); display: grid; place-items: center; color: var(--muted); font-size: 12px; background: rgba(255,255,255,.82); }

.property { min-width: 0; }
.property-body { padding: 14px; display: flex; flex-direction: column; gap: 14px; }
.field label { display: block; font-size: 11px; color: var(--muted); margin-bottom: 5px; }
.field-box { min-height: 34px; border: 1px solid var(--line); padding: 8px; background: #fff; font-size: 12px; }
.field-box.large { min-height: 78px; line-height: 1.5; }
.expert-row { display: flex; gap: 8px; align-items: center; }
.divider { height: 1px; background: var(--soft-line); }

.right-stack { display: flex; flex-direction: column; gap: 14px; min-height: 0; }

.workbench-grid { height: 100%; display: grid; grid-template-columns: 1fr 310px; gap: 18px; }
.quick-agent { border: 2px solid var(--ink); background: var(--accent-soft); padding: 22px; position: relative; }
.quick-agent h2 { font: 700 28px "Segoe Print", "KaiTi", cursive; margin: 0 0 8px; }
.prompt-box { margin-top: 18px; min-height: 104px; background: #fff; border: 1.5px solid var(--ink); padding: 14px; color: var(--muted); position: relative; }
.prompt-box .btn { position: absolute; right: 12px; bottom: 12px; }
.scheme-list { display: grid; grid-template-columns: repeat(3, 1fr); gap: 12px; margin-top: 16px; }
.scheme-card { border: 1.5px solid var(--ink); padding: 14px; background: #fff; min-height: 150px; position: relative; }
.scheme-card::before { content: ""; position: absolute; top: -4px; left: 14px; right: 14px; height: 3px; border-top: 1.5px solid var(--ink); }
.scheme-card h4 { margin: 12px 0 7px; }
.scheme-card p { color: var(--muted); font-size: 11px; line-height: 1.45; }
.scheme-card.generated { border-color: var(--accent); box-shadow: 3px 3px 0 var(--accent); }
.new-scheme-tag { position: absolute; top: 10px; right: 10px; padding: 3px 7px; background: var(--accent); color: #fff; font-size: 9px; }
.scheme-card-actions { position: absolute; right: 12px; bottom: 10px; display: flex; align-items: center; gap: 5px; }
.scheme-edit-link, .scheme-run-link { min-height: 26px; border: 0; padding: 0 8px; background: transparent; color: var(--accent); font-size: 9px; font-weight: 700; cursor: pointer; }
.scheme-run-link { border-radius: 5px; background: var(--accent); color: #fff; }
.mini-flow { display: flex; align-items: center; gap: 5px; margin-top: 14px; }
.mini-node { width: 18px; height: 18px; border: 1px solid var(--ink); background: var(--accent-soft); }
.mini-line { height: 1px; width: 18px; background: var(--ink); }
.activity { padding: 12px; display: flex; flex-direction: column; gap: 12px; }
.activity-item { border-bottom: 1px solid var(--soft-line); padding-bottom: 10px; }

.filters { display: flex; gap: 8px; margin-bottom: 16px; }
.filter { border: 1px solid var(--line); padding: 7px 12px; font-size: 12px; background: #fff; }
.filter.active { color: #fff; background: var(--ink); }
.library-grid { display: grid; grid-template-columns: repeat(3, 1fr); gap: 14px; }
.library-card { border: 1.5px solid var(--ink); padding: 16px; min-height: 205px; display: flex; flex-direction: column; background: #fff; }
.library-card .cover { height: 62px; border: 1px dashed var(--line); background: var(--paper); padding: 10px; display: flex; align-items: center; justify-content: space-between; }
.library-card h3 { font-size: 15px; margin: 15px 0 6px; }
.library-card p { font-size: 11px; color: var(--muted); line-height: 1.5; margin: 0; }
.library-card footer { margin-top: auto; padding-top: 12px; display: flex; justify-content: space-between; align-items: center; }
.library-actions { display: flex; gap: 6px; }
.library-actions .btn { padding: 0 9px; min-height: 30px; }

.detail-grid { height: 100%; display: grid; grid-template-columns: 1fr 340px; gap: 18px; }
.hero-card { border: 1.5px solid var(--ink); padding: 22px; background: #fff; }
.hero-card h2 { font: 700 28px "Segoe Print", "KaiTi", cursive; margin: 10px 0; }
.hero-card p { max-width: 670px; color: var(--muted); line-height: 1.6; font-size: 13px; }
.timeline { margin-top: 18px; display: grid; grid-template-columns: repeat(4,1fr); }
.timeline-step { border-top: 2px solid var(--accent); padding: 14px 10px 0; position: relative; }
.timeline-step::before { content: ""; width: 12px; height: 12px; border-radius: 50%; border: 2px solid var(--accent); background: #fff; position: absolute; top: -7px; left: 8px; }
.timeline-step strong { display: block; font-size: 12px; margin-bottom: 4px; }
.timeline-step span { font-size: 10px; color: var(--muted); }
.side-card { border: 1.5px solid var(--ink); background: #fff; padding: 16px; }
.stat-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; }
.stat { border: 1px solid var(--soft-line); padding: 12px; }
.stat strong { display: block; font: 700 20px "Segoe Print", cursive; }

.run-layout { height: 100%; display: grid; grid-template-columns: 300px 1fr 310px; gap: 14px; }
.run-steps { padding: 12px; }
.run-step { padding: 11px; border-left: 3px solid var(--soft-line); margin-bottom: 5px; font-size: 12px; }
.run-step.done { border-color: var(--success); }
.run-step.running { border-color: var(--accent); background: var(--accent-soft); }
.run-step.waiting { border-color: var(--note); }
.result-preview { height: 100%; display: flex; flex-direction: column; }
.doc-preview { flex: 1; margin: 18px; border: 1px solid var(--line); padding: 30px 42px; background: #fff; }
.doc-line { height: 8px; background: #d8d8d2; margin: 12px 0; }
.doc-line.title { width: 45%; height: 16px; background: var(--ink); }
.doc-line.short { width: 62%; }
.log { padding: 12px; display: flex; flex-direction: column; gap: 10px; }
.log-item { border-left: 2px solid var(--line); padding: 2px 0 2px 10px; font-size: 11px; line-height: 1.5; }
.log-item strong { display: block; }

.table { border: 1.5px solid var(--ink); background: #fff; }
.tr { display: grid; grid-template-columns: 1.6fr .8fr .8fr .8fr 90px; border-bottom: 1px solid var(--soft-line); min-height: 48px; align-items: center; }
.tr.head { background: var(--paper); font-weight: 700; font-size: 11px; }
.td { padding: 10px 12px; font-size: 12px; }
.progress { width: 90px; height: 6px; background: #e0e0dc; }
.progress > i { display: block; height: 100%; background: var(--accent); }

.dialog-scrim { position: fixed; inset: 0; z-index: 1000; display: grid; place-items: center; padding: 28px; background: rgba(25,28,35,.58); backdrop-filter: blur(5px); }
.conversation-modal, .scheme-editor-modal { width: min(1040px, calc(100vw - 56px)); height: min(720px, calc(100vh - 56px)); border: 1px solid #cdd0d8; border-radius: 18px; overflow: hidden; background: #fbfbfd; box-shadow: 0 28px 90px rgba(16,19,29,.32); display: flex; flex-direction: column; }
.conversation-modal.inline-conversation { width: 100%; height: 100%; border-radius: 12px; box-shadow: 0 5px 18px rgba(26,30,42,.08); }
.conversation-head { min-height: 76px; flex: none; padding: 16px 22px; border-bottom: 1px solid #e0e2e8; display: flex; align-items: center; justify-content: space-between; background: #fff; }
.conversation-head h2 { margin: 3px 0 0; font-size: 19px; letter-spacing: -.3px; }
.modal-kicker { color: var(--accent); font-size: 10px; font-weight: 800; letter-spacing: 1.1px; text-transform: uppercase; }
.modal-close { width: 34px; height: 34px; border: 0; border-radius: 50%; background: #f0f1f5; color: #59606d; font-size: 22px; line-height: 1; cursor: pointer; }
.modal-close:hover { background: #e4e6ed; color: var(--ink); }
.inline-status { display: flex; align-items: center; gap: 7px; color: #7e8490; font-size: 10px; }
.inline-status i { width: 7px; height: 7px; border-radius: 50%; background: var(--success); box-shadow: 0 0 0 3px #e3f2e9; }
.conversation-flow { min-height: 56px; flex: none; border-bottom: 1px solid #e0e2e8; padding: 0 26px; display: flex; align-items: center; justify-content: center; background: #f7f8fb; }
.conversation-flow > i { width: 70px; height: 1px; margin: 0 10px; background: #d5d8e0; }
.flow-state { display: flex; align-items: center; gap: 7px; color: #8c919b; font-size: 11px; font-weight: 700; }
.flow-state span { width: 22px; height: 22px; border: 1px solid #c9cdd6; border-radius: 50%; display: grid; place-items: center; background: #fff; font-size: 10px; }
.flow-state.active { color: var(--accent); }
.flow-state.active span { border-color: var(--accent); background: var(--accent); color: #fff; }
.conversation-body { flex: 1; min-height: 0; display: block; }
.message-stream { width: min(900px, 100%); height: 100%; min-height: 0; margin: 0 auto; overflow-y: auto; padding: 26px 54px; display: flex; flex-direction: column; gap: 16px; }
.dialog-message { display: flex; align-items: flex-start; gap: 10px; max-width: 84%; }
.dialog-message.user { align-self: flex-end; flex-direction: row-reverse; }
.dialog-message > div { min-width: 0; }
.dialog-message b { display: block; margin-bottom: 5px; color: #737985; font-size: 10px; }
.dialog-message p { margin: 0; border: 1px solid #e0e2e8; border-radius: 4px 14px 14px 14px; padding: 10px 13px; background: #fff; color: #363b44; font-size: 12px; line-height: 1.55; }
.dialog-message.user p { border-color: #cbd1ff; border-radius: 14px 4px 14px 14px; background: var(--accent-soft); }
.agent-avatar { width: 30px; height: 30px; flex: none; border-radius: 9px; display: grid; place-items: center; background: var(--accent); color: #fff; font: 800 12px "Segoe Print", cursive; box-shadow: 0 4px 12px rgba(80,100,216,.22); }
.prompt-suggestions { display: flex; flex-wrap: wrap; gap: 7px; padding-left: 40px; }
.prompt-suggestions button { border: 1px solid #d9dce5; border-radius: 14px; background: #fff; padding: 7px 10px; color: #555c68; font-size: 10px; cursor: pointer; }
.prompt-suggestions button:hover { border-color: var(--accent); color: var(--accent); background: #f7f8ff; }
.prompt-suggestions.compact { padding-left: 40px; }
.generate-callout { margin-left: 40px; border: 1px solid #bfc7ff; border-radius: 12px; padding: 14px; background: linear-gradient(135deg,#f5f6ff,#fff); display: flex; align-items: center; justify-content: space-between; gap: 18px; }
.generate-callout span { display: block; color: var(--success); font-size: 10px; font-weight: 800; }
.generate-callout b { display: block; margin: 4px 0; font-size: 13px; }
.generate-callout p { margin: 0; color: var(--muted); font-size: 10px; }
.generate-callout.saved { border-color: #a8d0b8; background: #f3faf6; }
.generate-actions { display: flex; flex: none; gap: 7px; }
.saved-label { display: flex !important; align-items: center; color: var(--success) !important; font-size: 10px !important; }
.generate-actions .btn { min-height: 31px; padding: 0 10px; font-size: 10px; box-shadow: none; border-radius: 7px; }
.workflow-decision { border-color: #aeb8f3; background: #f7f8ff; }
.workflow-preview-callout { margin-left: 40px; border: 1px solid #b9c2ef; border-radius: 13px; padding: 14px; background: #fff; box-shadow: 0 8px 22px rgba(48,59,118,.08); }
.workflow-preview-head { display: flex; align-items: flex-start; justify-content: space-between; gap: 18px; }
.workflow-preview-head > div { min-width: 0; }
.workflow-preview-head .preview-ready { display: block; color: var(--success); font-size: 10px; font-weight: 800; }
.workflow-preview-head b { display: block; margin: 4px 0; font-size: 13px; }
.workflow-preview-head p { margin: 0; color: var(--muted); font-size: 10px; line-height: 1.45; }
.preview-step-count { flex: none; border-radius: 12px; padding: 4px 8px; background: var(--accent-soft); color: var(--accent); font-size: 9px; font-weight: 800; }
.preview-flow-mini { margin-top: 13px; display: flex; align-items: center; }
.preview-flow-mini > div { min-width: 92px; border: 1px solid #d9ddec; border-radius: 8px; padding: 8px; background: #fafbff; }
.preview-flow-mini > div span { display: block; margin-bottom: 3px; color: var(--accent); font-size: 8px; font-weight: 800; }
.preview-flow-mini > div b { display: block; color: #444a57; font-size: 9px; white-space: nowrap; }
.preview-flow-mini > i { flex: 1; min-width: 12px; height: 1px; background: #aeb8f3; position: relative; }
.preview-flow-mini > i::after { content: ""; position: absolute; right: -1px; top: -2px; width: 4px; height: 4px; border-top: 1px solid var(--accent); border-right: 1px solid var(--accent); transform: rotate(45deg); }
.workflow-preview-actions { margin-top: 13px; display: flex; justify-content: flex-end; gap: 7px; }
.workflow-preview-actions .btn { min-height: 32px; border-radius: 7px; box-shadow: none; font-size: 10px; }
.context-panel { min-width: 0; padding: 22px 18px; border-left: 1px solid #e0e2e8; background: #f5f6f9; }
.context-panel h3 { margin: 5px 0 18px; font-size: 15px; }
.context-panel dl { margin: 0; display: flex; flex-direction: column; gap: 10px; }
.context-panel dl div { padding-bottom: 10px; border-bottom: 1px solid #dfe1e7; }
.context-panel dt { margin-bottom: 4px; color: #868c96; font-size: 9px; }
.context-panel dd { margin: 0; color: #363b44; font-size: 11px; font-weight: 700; }
.data-route { margin-top: 20px; padding: 12px; border: 1px solid #d8dbe4; border-radius: 10px; background: #fff; display: flex; flex-direction: column; align-items: stretch; gap: 7px; }
.data-route span { border: 1px solid #d8dbe4; border-radius: 6px; padding: 7px; text-align: center; color: #555c68; font-size: 9px; }
.data-route i { width: 1px; height: 9px; margin: 0 auto; background: var(--accent); }
.dialog-composer { flex: none; min-height: 100px; border-top: 1px solid #e0e2e8; padding: 12px 18px; background: #fff; }
.dialog-composer textarea { width: 100%; height: 45px; resize: none; border: 0; outline: none; color: var(--ink); font-size: 12px; }
.dialog-composer > div { display: flex; align-items: center; justify-content: space-between; }
.dialog-composer span { color: #9a9fa9; font-size: 9px; }
.send-button { min-width: 70px; min-height: 31px; border: 0; border-radius: 8px; background: var(--accent); color: #fff; font-size: 11px; font-weight: 700; cursor: pointer; }
.send-button:disabled { opacity: .38; cursor: not-allowed; }

.scheme-editor-modal { width: min(930px, calc(100vw - 56px)); height: auto; max-height: calc(100vh - 56px); }
.scheme-editor-body { min-height: 0; padding: 22px; display: grid; grid-template-columns: 320px 1fr; gap: 24px; overflow: auto; }
.editor-fields { display: flex; flex-direction: column; gap: 15px; }
.editor-fields label { color: #737985; font-size: 10px; font-weight: 700; }
.editor-fields input, .editor-fields textarea { width: 100%; margin-top: 6px; border: 1px solid #d5d8e0; border-radius: 8px; padding: 10px; background: #fff; color: var(--ink); font-size: 12px; outline: none; }
.editor-fields textarea { min-height: 94px; resize: vertical; line-height: 1.5; }
.editor-fields input:focus, .editor-fields textarea:focus, .editable-step input:focus { border-color: var(--accent); }
.expert-note { border-radius: 10px; padding: 12px; display: flex; gap: 10px; background: var(--accent-soft); }
.expert-note p { margin: 0; color: #4f5663; font-size: 10px; line-height: 1.55; }
.expert-note b { display: block; margin-bottom: 3px; color: #3548ba; }
.step-editor { min-width: 0; border-left: 1px solid #e0e2e8; padding-left: 24px; }
.step-editor-head { display: flex; align-items: center; justify-content: space-between; margin-bottom: 14px; }
.step-editor-head h3 { margin: 4px 0 0; font-size: 16px; }
.step-editor-head .btn { display: flex; align-items: center; gap: 5px; min-height: 31px; border-radius: 7px; box-shadow: none; font-size: 10px; }
.editable-steps { display: flex; flex-direction: column; gap: 8px; }
.editable-step { min-height: 48px; border: 1px solid #daddE5; border-radius: 9px; padding: 7px 9px; display: grid; grid-template-columns: 30px 1fr auto; align-items: center; gap: 8px; background: #fff; }
.editable-step > span { width: 26px; height: 26px; border-radius: 7px; display: grid; place-items: center; background: var(--accent-soft); color: var(--accent); font-size: 9px; font-weight: 800; }
.editable-step input { min-width: 0; border: 1px solid transparent; border-radius: 6px; padding: 6px; color: var(--ink); font-size: 11px; outline: none; }
.editable-step button { border: 0; background: transparent; color: #9a6c68; font-size: 9px; cursor: pointer; }
.scheme-editor-footer { min-height: 68px; border-top: 1px solid #e0e2e8; padding: 0 22px; display: flex; align-items: center; justify-content: space-between; background: #fff; }
.scheme-editor-footer > span { color: #888e98; font-size: 10px; }
.scheme-editor-footer > div { display: flex; gap: 8px; }
.scheme-editor-footer .btn { border-radius: 7px; box-shadow: none; }
.scheme-toast { position: fixed; right: 24px; bottom: 24px; z-index: 1100; min-width: 360px; border: 1px solid #cfd3dc; border-radius: 12px; padding: 12px 40px 12px 12px; display: grid; grid-template-columns: 34px 1fr auto; align-items: center; gap: 10px; background: #fff; box-shadow: 0 14px 36px rgba(20,24,35,.2); }
.toast-check { width: 30px; height: 30px; border-radius: 50%; display: grid; place-items: center; background: #e5f4eb; color: var(--success); font-weight: 800; }
.scheme-toast b { font-size: 11px; }
.scheme-toast p { margin: 3px 0 0; color: var(--muted); font-size: 9px; }
.scheme-toast > button:not(.toast-close) { border: 0; background: transparent; color: var(--accent); font-size: 10px; font-weight: 700; cursor: pointer; }
.toast-close { position: absolute; top: 7px; right: 8px; border: 0; background: transparent; color: #999fa8; font-size: 16px; cursor: pointer; }

@media (max-width: 900px) {
  .screen { transform-origin: top left; }
  .message-stream { padding: 22px; }
  .scheme-editor-body { grid-template-columns: 1fr; }
  .step-editor { border-left: 0; border-top: 1px solid #e0e2e8; padding: 18px 0 0; }
}
