:root {
  --bg-main: #0c171a;
  --bg-sidebar: #102024;
  --bg-card: #14282c;
  --bg-card-hover: #1a3337;
  --bg-input: #102024;
  --bg-elevated: #1c3438;
  --border-subtle: #233c40;
  --border-card: #2d494d;
  --accent: #65e64b;
  --accent-base: #087b48;
  --accent-hover: #066338;
  --accent-glow: rgba(0, 191, 98, .2);
}
:root[data-theme="light"] {
  --bg-main: #f3f8f5;
  --bg-sidebar: #ffffff;
  --bg-card: #ffffff;
  --bg-card-hover: #edf7f0;
  --bg-input: #ffffff;
  --bg-elevated: #f0f7f3;
  --border-subtle: #e2eee6;
  --border-card: #cfdfd5;
  --text-primary: #173035;
  --text-secondary: #425e58;
  --text-muted: #587369;
  --text-dim: #62786f;
  --accent: #087b48;
  --accent-base: #087b48;
  --accent-hover: #066338;
  --accent-glow: rgba(0, 155, 83, .16);
}
.brand, .auth-brand { justify-content: center; }
.brand-name { display: none; }
.zf-app-brand > span:not(.zapforge-logo), .zf-site-brand > b { display: none; }
.zf-app-brand { min-height: 64px; }
.sidebar { overflow-y: auto; }
.app.collapsed .zf-app-brand { min-height: 56px; }
.zapforge-logo, .zf-app-brand > .zapforge-logo { display: inline-flex; flex-direction: row; align-items: center; gap: 9px; width: auto; height: 48px; flex: none; background: transparent; }
.zapforge-logo .zapforge-wordmark { width: 180px; height: 60px; object-fit: contain; }
.zapforge-logo .zapforge-compact { display: none; width: 42px; height: 42px; }
.app.collapsed .zapforge-wordmark { display: none; }
.app.collapsed .zapforge-compact { display: block; }
.auth-brand { background: #082225; border-radius: 14px; padding: 12px; }
.zapforge-logo b { font-size: 23px; font-weight: 800; letter-spacing: -.8px; color: #087b48; white-space: nowrap; }
.zapforge-logo b span { color: #173035; }
.sidebar .zapforge-logo b, .zf-site-brand .zapforge-logo b { color: #8bef52; }
.sidebar .zapforge-logo b span, .zf-site-brand .zapforge-logo b span { color: #fff; }
.app.collapsed .zapforge-logo b { display: none; }
.avatar { background: #087b48; color: #fff; line-height: 1; font-family: var(--font); }
#avatar-btn .avatar { width: 36px; height: 36px; border-radius: 50%; font-size: 14px; }
.flow-node { width: 238px; height: 88px; min-height: 88px; }
.flow-node-main { height: 86px; }
.flow-output-handle { position: absolute; right: 0; width: 0; height: 0; z-index: 5; }
.flow-output-handle > span { position: absolute; top: 0; transform: translateY(-50%); white-space: nowrap; pointer-events: none; }
.flow-output-handle > span:empty { display: none; }
.flow-output-handle .flow-port { top: 0; }
.execution-drawer, .workflow-diagnostics { display: none; width: min(380px, calc(100% - 28px)); overflow-y: auto; background: #fff; border: 1px solid #dce7e4; color: #173035; z-index: 12; }
.execution-drawer.open, .workflow-diagnostics.open { display: block; }
.execution-drawer-head, .workflow-diagnostics-head { display: flex; align-items: center; justify-content: space-between; gap: 12px; padding: 18px; border-bottom: 1px solid #e2eee6; }
.execution-drawer-head small, .workflow-diagnostics-head small { display: block; margin-top: 5px; color: #62786f; font-size: 11px; }
.workflow-diagnostics-body, .execution-list, .execution-preview-summary { padding: 16px; }
.diagnostic-ok, .diagnostic-item { display: flex; align-items: flex-start; gap: 10px; padding: 12px; background: #f0f7f3; border-radius: 10px; }
.diagnostic-ok span { display: block; margin-top: 6px; font-size: 12px; }
.flow-inspector .field { margin: 0 16px 16px; }
.flow-inspector .field-help { line-height: 1.5; }
.automation-stage .flow-inspector:not(.open), .node-library:not(.open), .workflow-drawer:not(.open) { display: none; }
.execution-list { display: flex; flex-direction: column; gap: 10px; }
.execution-row { display: grid; grid-template-columns: 10px minmax(0, 1fr) auto; align-items: center; gap: 12px; width: 100%; padding: 14px; border: 1px solid #e0e9e5; border-radius: 12px; background: #fff; color: #173035; text-align: left; cursor: pointer; font: inherit; }
.execution-row:hover { background: #f3faf6; border-color: #90c8af; }
.execution-row.active { background: #e9f8ef; border-color: #087b48; box-shadow: inset 3px 0 #087b48; }
.execution-row:focus-visible { outline: 2px solid #087b48; outline-offset: 2px; }
.execution-row b, .execution-row small { display: block; }
.execution-row b { font-size: 13px; line-height: 1.5; }
.execution-row small { margin-top: 5px; font-size: 10px; color: #62786f; line-height: 1.5; }
.execution-row em { padding: 4px 6px; border-radius: 6px; background: #eff5f2; font-size: 9px; font-style: normal; color: #426957; }
.execution-row em:empty { display: none; }
.execution-dot { width: 9px; height: 9px; border-radius: 50%; background: #7d939b; }
.execution-dot.completed { background: #0ba56a; }
.execution-dot.human, .execution-dot.handoff, .execution-dot.snoozed { background: #e4a318; }
.execution-dot.failed, .execution-dot.blocked { background: #dd4b4b; }
.execution-dot.processing { background: #368be3; }
.execution-preview-summary { margin: 0 16px 16px; padding: 14px; background: #f6faf8; border: 1px solid #e0e9e5; border-radius: 12px; }
.execution-preview-summary > b { font-size: 13px; }
.execution-preview-summary p { margin: 8px 0 12px; font-size: 12px; color: #62786f; line-height: 1.6; }
.execution-test-output { white-space: pre-wrap; overflow-wrap: anywhere; padding: 12px; font-size: 12px; line-height: 1.6; border: 1px solid #dce7e4; border-radius: 8px; background: #fff; }
.execution-loading { padding: 24px; color: #62786f; font-size: 13px; }
.execution-node-data { padding: 18px; overflow-y: auto; }
.execution-node-data h3 { margin: 22px 0 10px; font-size: 13px; }
.execution-node-json { margin: 0; padding: 14px; border: 1px solid #dce7e4; border-radius: 10px; background: #f4f8f6; color: #173035; font: 12px/1.7 var(--mono); white-space: pre-wrap; overflow-wrap: anywhere; }
.execution-data-empty { color: #62786f; font-size: 12px; line-height: 1.6; }
.flow-inspector-head:has(+ .execution-node-data) { grid-template-columns: minmax(0, 1fr) 36px; }
.flow-inspector-head:has(+ .execution-node-data) > div { min-width: 0; }
.flow-inspector-head:has(+ .execution-node-data) h3, .flow-inspector-head:has(+ .execution-node-data) p { white-space: normal; }
.flow-node.run-completed { border-color: #0ba56a; }
.flow-run-badge { position: absolute; left: 12px; bottom: -22px; padding: 3px 7px; border-radius: 6px; font-size: 9px; background: #e1f7e9; color: #087b48; }
#modal-body{min-height:0;overflow:auto}.modal-head,.modal-foot{flex-shrink:0}.workflow-version-row{display:flex;align-items:center;justify-content:space-between;gap:16px;padding:16px 0;border-bottom:1px solid #e4eeeb}.workflow-version-row p{margin:6px 0;font-size:13px}.workflow-version-row small{color:#637970}.mapping-select{font-size:12px;margin-top:4px}.conversation-head .actions{flex-wrap:wrap}.automation-editor-actions{flex-wrap:wrap}
#version-size{position:relative;min-width:1px;min-height:1px}.workflow-preview{position:relative;height:430px;overflow:auto;background:#f0f6f4;border:1px solid #d5e3de;border-radius:12px;margin:12px 0}.workflow-preview .flow-node{cursor:pointer}.workflow-preview .flow-edge-hit{pointer-events:none}#version-node-detail{white-space:pre-wrap;overflow-wrap:anywhere}#version-node-detail dd{margin:0 0 12px;color:#52665f}#version-node-detail dt{font-weight:600}.field-mapping summary{cursor:pointer;font-size:12px;color:#52665f;margin-top:6px}
.node-library.open,.workflow-drawer.open,.automation-stage .flow-inspector.open{z-index:8}
.template-card>b{font-size:13px}.template-card>small{grid-column:2;font-size:12px;line-height:1.45}.template-card>small+small{margin-top:6px;color:#52665f}
.structured-field-row{display:flex;align-items:end;flex-wrap:wrap;gap:8px;margin:8px 0}.structured-field-row>select{flex:1 1 100%}.structured-field-row label{flex:1;min-width:75px}.structured-field-row .menu-option-label{flex:3}.structured-field[hidden]{display:none}
