/* ---------- automations center ---------- */
.auto-modal { overflow: hidden !important; }
.ac-head { display: grid; grid-template-columns: 1fr auto 1fr; align-items: center; padding: 20px 24px; border-bottom: 1px solid var(--border); flex: none; }
.ac-head > :last-child { justify-self: end; }
.ac-title { font-family: var(--title); font-size: 20px; }
.ac-title b { font-weight: 600; }
.ac-seg button { width: 146px; padding: 8px 0; font-size: 16px; }
.ac-body { flex: 1; display: flex; min-height: 0; }
.ac-side { width: 290px; background: #f5f6f8; padding: 24px 16px; display: flex; flex-direction: column; gap: 2px; flex: none; }
.ac-side h3 { font-size: 20px; padding: 0 16px 10px; font-weight: 600; }
.ac-side > button:not(.btn) { display: flex; align-items: center; gap: 10px; padding: 9px 16px; border-radius: 4px; text-align: left; font-size: 15px; }
.ac-side > button:not(.btn):hover { background: var(--hover); }
.ac-side > button.on { background: var(--selected); }
.ac-main { flex: 1; overflow: auto; padding: 16px 64px 48px; }
.ac-search { position: sticky; top: -16px; background: #fff; padding: 16px 0 8px; z-index: 2; }
.ac-sbox { display: flex; align-items: center; gap: 10px; border: 1px solid var(--primary); border-radius: 4px; height: 40px; padding: 0 12px; max-width: 808px; }
.ac-sbox input { flex: 1; border: 0; outline: 0; font-size: 16px; }
.ac-h { font-size: 24px; font-weight: 500; margin: 28px 0 14px; display: flex; align-items: center; gap: 8px; }
.ac-h .linkbtn { font-size: 15px; font-family: var(--font); }
.tpl-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(220px, 1fr)); gap: 24px; max-width: 1180px; }
.tpl-card { border: 1px solid var(--border); border-radius: 8px; padding: 18px 16px 16px; min-height: 254px; display: flex; flex-direction: column; gap: 14px; background: #fff; transition: box-shadow .15s; }
.tpl-card:hover { box-shadow: var(--sh-s); }
.tpl-card .tpl-s { font-size: 19px; line-height: 27px; flex: 1; font-weight: 300; }
.tpl-card .tpl-s b { font-weight: 600; }
.tpl-card .btn { justify-content: center; }
.tpl-card.scratch { align-items: center; justify-content: center; cursor: pointer; font-size: 19px; gap: 12px; }
.tpl-logo { width: 32px; height: 32px; border-radius: 50%; border: 1px solid var(--border); display: flex; align-items: center; justify-content: center; gap: 1px; }
.tpl-logo { color: var(--primary); }
.ac-mhead { display: flex; align-items: center; justify-content: space-between; margin: 12px 0 16px; }
.am-row { display: flex; align-items: center; gap: 16px; padding: 16px; border: 1px solid var(--border); border-radius: 8px; margin-top: 12px; }
.am-row .am-s { flex: 1; font-size: 16px; line-height: 24px; }

/* sentence builder */
.ab-top { display: flex; align-items: center; padding: 20px 24px; flex: none; }
.ab-wrap { flex: 1; overflow: auto; padding: 60px 0 0 max(40px, calc(50% - 400px)); }
.ab-lines { max-width: 820px; }
.ab-line { display: flex; align-items: flex-start; gap: 16px; }
.ab-s { flex: 1; font-family: var(--title); font-size: 30px; line-height: 50px; font-weight: 300; color: var(--text); }
.ab-acts { display: flex; gap: 4px; padding-top: 9px; }
.ab-acts .iconbtn { width: 36px; height: 36px; }
.tok { color: #c3c6d4; border-bottom: 2px solid var(--text); cursor: pointer; white-space: nowrap; transition: color .1s; }
.tok:hover { color: var(--primary); border-color: var(--primary); }
.tok.on { color: var(--primary); border-bottom-color: var(--primary); }
.ab-arrow { color: #00854d; margin: 6px 0 6px -6px; }
.ab-wrap > .btn { margin-top: 40px; }
.tokpop { padding: 8px 8px 10px; min-width: 260px; }
.defmenu { max-height: 70vh; }

/* integrations */
.integ-hero { background: #292f4c; color: #fff; border-radius: 8px; padding: 28px 32px; display: flex; align-items: center; justify-content: space-between; gap: 20px; max-width: 1180px; }
.integ-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(170px, 1fr)); gap: 16px; max-width: 1180px; }
.integ-tile { height: 70px; border-radius: 8px; border: 1px solid var(--border); display: flex; align-items: center; gap: 10px; padding: 0 14px; font-size: 16px; font-weight: 500; position: relative; background: #fff; }
.integ-tile:hover { box-shadow: var(--sh-s); }
.integ-dot { width: 32px; height: 32px; border-radius: 8px; color: #fff; display: flex; align-items: center; justify-content: center; font-weight: 700; flex: none; }
.integ-on { position: absolute; right: 8px; top: 6px; font-size: 11px; color: var(--positive); font-weight: 400; }

/* ---------- workflows home ---------- */
.wf-home { display: flex; flex: 1; min-height: 0; height: 100%; }
.wf-side { width: 262px; border-right: 1px solid var(--border); display: flex; flex-direction: column; flex: none; }
.wf-side .side-list { padding-top: 6px; }
.wf-dot { width: 8px; height: 8px; border-radius: 50%; background: #00c875; flex: none; }
.wf-main { position: relative; background-image: radial-gradient(#e7e9ef 1px, transparent 1px); background-size: 16px 16px; }
.wf-scratch { position: absolute; right: 24px; top: 16px; }
.wf-hero { text-align: center; padding: 64px 20px 20px; }
.wf-hero h1 { font-size: 36px; font-weight: 600; }
.wf-hero p { font-size: 16px; margin: 10px 0 30px; }
.wf-prompt { max-width: 660px; margin: 0 auto; background: #fff; border-radius: 12px; border: 1px solid #c5b9ff; box-shadow: 0 0 30px rgba(130,110,255,.35), 0 0 14px rgba(0,200,255,.25); text-align: left; padding: 14px 16px 10px; }
.wf-prompt textarea { width: 100%; border: 0; outline: 0; resize: none; height: 56px; font-size: 16px; }
.wf-pfoot { display: flex; align-items: center; gap: 12px; color: var(--text2); }
.wf-pfoot .muted { display: flex; align-items: center; gap: 6px; }
.wf-send { width: 32px; height: 32px; border-radius: 4px; background: var(--primary); color: #fff; display: flex; align-items: center; justify-content: center; transform: rotate(-90deg); }
.wf-chips { display: flex; gap: 8px; justify-content: center; flex-wrap: wrap; margin-top: 22px; }
.wf-chip { border: 1px solid var(--border); border-radius: 4px; padding: 6px 10px; background: #fff; font-size: 14px; }
.wf-chip:hover { background: var(--hover); }
.wf-tpls { max-width: 940px; margin: 40px auto; padding: 0 20px 60px; }
.wf-tpls h2 { font-size: 20px; margin-bottom: 16px; }
.wf-tgrid { display: grid; grid-template-columns: repeat(3, 1fr); gap: 16px; }
.wf-tcard { background: #fff; border: 1px solid var(--border); border-radius: 8px; padding: 20px 24px; cursor: pointer; }
.wf-tcard:hover { box-shadow: var(--sh-s); }
.wf-tcard b { font-weight: 600; font-size: 16px; }
.wf-tcard p { color: var(--text2); margin: 6px 0 14px; line-height: 20px; display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden; }
.wf-ticons { display: flex; gap: 6px; color: var(--primary); }
.wf-create { display: grid; grid-template-columns: 1fr 230px; gap: 24px; align-items: center; }
.wf-create-art { background: var(--grey-bg); border-radius: 8px; height: 260px; display: flex; align-items: center; justify-content: center; color: var(--primary); }

/* ---------- workflow builder ---------- */
.wf-b { display: flex; flex-direction: column; height: 100%; }
.wf-top { display: flex; align-items: center; gap: 10px; height: 54px; padding: 0 16px; border-bottom: 1px solid var(--border); flex: none; }
.wf-name { font-size: 16px; font-weight: 600; padding: 2px 6px; border: 1px solid transparent; border-radius: 4px; cursor: text; }
.wf-name:hover { border-color: var(--border); }
.wf-body { flex: 1; display: flex; min-height: 0; position: relative; }
.wf-left { width: 400px; padding: 20px 24px; border-right: 1px solid var(--border); overflow: auto; flex: none; }
.wf-lhead { display: flex; justify-content: space-between; align-items: center; }
.wf-lhead b { display: flex; gap: 8px; align-items: center; font-weight: 500; font-size: 16px; }
.wf-hi { font-size: 30px; text-align: center; margin-top: 36px; font-weight: 600; }
.wf-sub { text-align: center; font-size: 16px; line-height: 24px; margin: 8px 0 24px; }
.wf-next { border: 1px solid var(--border); border-radius: 8px; padding: 16px; display: flex; flex-direction: column; gap: 14px; }
.wf-ns { display: flex; align-items: center; gap: 10px; }
.wf-ns.done { color: var(--text2); text-decoration: line-through; }
.wf-ns.done .ic { color: #00c875; }
.wf-steps { margin-left: auto; border: 1px solid var(--primary); color: var(--primary); border-radius: 4px; padding: 1px 8px; font-size: 13px; }
.wf-showleft { position: absolute; left: 8px; top: 8px; z-index: 5; width: 28px; height: 28px; border-radius: 50%; border: 1px solid var(--border); background: #fff; display: flex; align-items: center; justify-content: center; }
.wf-canvas { flex: 1; position: relative; overflow: hidden; background-color: #f6f7fb; background-image: radial-gradient(#c3c6d4 1px, transparent 1px); background-size: 18px 18px; cursor: grab; }
.wf-canvas.panning { cursor: grabbing; }
.wf-world { position: absolute; left: 0; top: 0; transform-origin: 0 0; }
.wf-lines { position: absolute; overflow: visible; pointer-events: none; }
.wf-lines path { fill: none; stroke: #c3c6d4; stroke-width: 1.5; }
.wf-lines path.pink { stroke: #e2a4cc; }
.wf-lines path.dash { stroke-dasharray: 4 4; }
.wf-node { position: absolute; width: 290px; height: 125px; background: #fff; border: 1px solid #e7e9ef; border-radius: 12px; box-shadow: var(--sh-xs); padding: 12px 14px; cursor: pointer; display: flex; flex-direction: column; gap: 8px; }
.wf-node:hover { border-color: var(--ui-border); }
.wf-node.sel { border-color: var(--primary); box-shadow: 0 0 0 1px var(--primary), var(--sh-xs); }
.wf-node.empty { border: 1.5px dashed var(--ui-border); background: #fff; align-items: flex-start; }
.wf-choose { display: flex; align-items: center; gap: 6px; color: var(--primary); font-size: 16px; font-weight: 600; }
.wf-num { position: absolute; left: -46px; top: 50px; width: 24px; height: 24px; border-radius: 50%; color: var(--text2); font-size: 14px; display: flex; align-items: center; justify-content: center; }
.wf-node.sel .wf-num { background: var(--primary); color: #fff; }
.wf-nh { display: flex; align-items: center; justify-content: space-between; }
.wf-pill { display: inline-flex; align-items: center; gap: 4px; font-size: 12px; line-height: 16px; font-weight: 600; padding: 3px 6px; border-radius: 4px; }
.wf-pill.trig { color: #0f9b63; background: #e3f7ec; }
.wf-pill.cond { color: #c24e9a; background: #fbe9f5; }
.wf-pill.act { color: var(--primary); background: var(--highlight); }
.wf-pill.wait { color: #9d50dd; background: #f3eafc; }
.wf-nt { display: flex; align-items: center; gap: 8px; font-size: 16px; line-height: 22px; font-weight: 600; min-width: 0; }
.wf-nt span { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.wf-req { align-self: flex-start; background: #fde8eb; color: #d83a52; font-size: 13px; padding: 2px 6px; border-radius: 4px; }
.wf-ok { align-self: flex-start; color: #0f9b63; font-size: 13px; padding: 2px 0; }
.wf-port { position: absolute; left: 50%; bottom: -6px; width: 11px; height: 11px; margin-left: -6px; border-radius: 50%; border: 2px solid #fff; background: #c3c6d4; box-shadow: 0 0 0 1px #c3c6d4; }
.wf-port.top { top: -6px; bottom: auto; }
.wf-port.green { background: #8fd9b0; box-shadow: 0 0 0 1px #0f9b63; }
.wf-port.pink { background: #e2a4cc; box-shadow: 0 0 0 1px #c24e9a; }
.wf-plus { position: absolute; width: 30px; height: 30px; border: 1px solid var(--ui-border); border-radius: 4px; background: #fff; display: flex; align-items: center; justify-content: center; }
.wf-plus:hover { border-color: var(--primary); color: var(--primary); }
.wf-plus.mini { width: 22px; height: 22px; border-radius: 50%; opacity: 0; }
.wf-plus.mini:hover { opacity: 1; }
.wf-branch { position: absolute; background: #fff; border: 1px solid var(--border); border-radius: 4px; padding: 2px 10px; font-size: 14px; width: 56px; text-align: center; }
.wf-tools { position: absolute; right: 12px; top: 12px; background: #fff; border-radius: 8px; box-shadow: var(--sh-xs); border: 1px solid var(--border); display: flex; flex-direction: column; }
.wf-panel { width: 400px; border-left: 1px solid var(--border); background: #fff; display: flex; flex-direction: column; flex: none; box-shadow: -4px 0 12px rgba(0,0,0,.05); }
.wf-ph { display: flex; align-items: center; gap: 8px; padding: 18px 16px; border-bottom: 1px solid var(--border); }
.wf-ph b { font-weight: 600; font-size: 16px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.wf-pb { padding: 8px 20px 24px; overflow: auto; }
.wf-q { font-weight: 500; margin: 12px 0 0; }
.wf-field { width: 100%; height: 40px; border: 1px solid var(--ui-border); border-radius: 4px; display: flex; align-items: center; justify-content: space-between; padding: 0 12px; color: var(--text2); text-align: left; }
.wf-field.on { color: var(--text); }
.wf-field:hover { border-color: var(--text); }
.req { color: var(--negative); margin-left: 2px; }
.wf-preview { margin-top: 24px; padding: 14px; background: var(--grey-bg); border-radius: 8px; font-size: 16px; line-height: 26px; }
.wf-preview .tok { cursor: default; border-bottom-width: 1px; }
.wf-addstep { width: 330px; padding: 8px; }
.wf-step { display: flex; gap: 12px; width: 100%; padding: 10px; border-radius: 6px; text-align: left; align-items: center; }
.wf-step:hover { background: var(--hover); }
.wf-step.disabled { opacity: .45; cursor: default; }
.wf-step b { display: block; font-weight: 600; }
.wf-step small { color: var(--text2); font-size: 13px; }
.wf-sic { width: 34px; height: 34px; border-radius: 8px; display: flex; align-items: center; justify-content: center; flex: none; }
.wf-sic.action { background: var(--highlight); color: var(--primary); } .wf-sic.condition { background: #fbe9f5; color: #c24e9a; } .wf-sic.wait { background: #f3eafc; color: #9d50dd; } .wf-sic.loop, .wf-sic.agent { background: var(--grey-bg); }
.wf-run { border: 1px solid var(--border); border-radius: 8px; padding: 12px 16px; margin-bottom: 12px; }
.wf-rh { display: flex; gap: 12px; align-items: center; margin-bottom: 6px; }
.wf-rh .ok { color: var(--positive); font-weight: 600; } .wf-rh .bad { color: var(--negative); font-weight: 600; }
.wf-rs { display: grid; grid-template-columns: 20px 1fr auto; gap: 8px; align-items: center; padding: 4px 0; font-size: 14px; }
