/* Oqeria Flow — builds on crm.css */
body.flow { --p: #059669; --p2: #10B981; --pl: #E7F8F1; --c: #6366F1; }
[data-theme="dark"] body.flow { --pl: rgba(16,185,129,.15); }
body.flow .btn { box-shadow: 0 1px 2px rgba(5,150,105,.3), inset 0 1px 0 rgba(255,255,255,.15); }
body.flow .btn:hover { background: #047857; box-shadow: 0 6px 16px -4px rgba(5,150,105,.45); }
body.flow .btn.gh:hover { background: var(--s2); }
body.flow .btn.gh, body.flow .btn.danger { box-shadow: var(--sh); }
body.flow .btn.gh:hover, body.flow .btn.danger:hover { box-shadow: var(--sh); }
[data-theme="dark"] body.flow .nav a.on { color: #6EE7B7; }
.demo-bar .db-cta { background: linear-gradient(90deg, #10B981, #6366F1); }
.mono { font-family: 'JetBrains Mono', ui-monospace, Menlo, monospace; }

.app-ic { width: 34px; height: 34px; border-radius: 10px; display: grid; place-items: center; color: #fff; flex: none; font: 800 13px Manrope, Inter, sans-serif; box-shadow: inset 0 0 0 1px rgba(255,255,255,.15); }
.app-ic svg { width: 17px; height: 17px; stroke-width: 2.1; }
.app-ic.s { width: 26px; height: 26px; border-radius: 8px; } .app-ic.s svg { width: 14px; height: 14px; }
.app-ic.l { width: 44px; height: 44px; border-radius: 12px; } .app-ic.l svg { width: 22px; height: 22px; }
.chain { display: flex; align-items: center; gap: 4px; flex-wrap: wrap; }
.chain .ar { color: var(--mu); font-size: 12px; }

/* live dot */
.live { display: inline-flex; align-items: center; gap: 6px; font-size: 12px; font-weight: 600; color: var(--ok); }
.live::before { content: ''; width: 8px; height: 8px; border-radius: 50%; background: var(--ok); box-shadow: 0 0 0 0 rgba(18,183,106,.5); animation: lp 1.6s infinite; }
@keyframes lp { 70% { box-shadow: 0 0 0 7px rgba(18,183,106,0); } 100% { box-shadow: 0 0 0 0 rgba(18,183,106,0); } }
.feed .fi.new { animation: newrow .6s var(--ease); }
@keyframes newrow { from { opacity: 0; transform: translateY(-8px); background: var(--pl); } }

/* workflow cards */
.wf-card { padding: 16px 18px; display: flex; flex-direction: column; gap: 12px; cursor: pointer; transition: transform .15s, box-shadow .2s, border-color .2s; }
.wf-card:hover { transform: translateY(-2px); box-shadow: var(--sh2); border-color: var(--line2); }
.wf-card h3 { font-size: 15px; }
.wf-card .meta { display: flex; gap: 14px; font-size: 12.5px; color: var(--mu); flex-wrap: wrap; }
.wf-card .meta b { color: var(--t); font-weight: 600; }
.wf-card.off { opacity: .65; }

/* builder */
.bld { display: grid; grid-template-columns: minmax(0, 1fr) 360px; gap: 18px; align-items: start; }
.bld-head { display: flex; align-items: center; gap: 10px; margin-bottom: 16px; flex-wrap: wrap; }
.bld-head .nm { font: 800 19px Manrope, Inter, sans-serif; border: 1px solid transparent; background: none; padding: 4px 8px; border-radius: 8px; min-width: 0; width: auto; max-width: 420px; color: var(--t); }
.bld-head .nm:hover, .bld-head .nm:focus { border-color: var(--line2); outline: none; background: var(--bg2); }
.canvas { position: relative; border-radius: 18px; border: 1px solid var(--line); min-height: 520px; padding: 34px 20px 60px; background-color: var(--s2); background-image: radial-gradient(var(--line2) 1px, transparent 1px); background-size: 18px 18px; display: flex; flex-direction: column; align-items: center; }
.node { width: 100%; max-width: 420px; background: var(--s1); border: 1.5px solid var(--line); border-radius: 16px; padding: 14px 16px; display: flex; gap: 12px; align-items: center; cursor: pointer; position: relative; box-shadow: var(--sh); transition: border-color .2s, box-shadow .2s, transform .15s; }
.node:hover { border-color: var(--line2); transform: translateY(-1px); }
.node.sel { border-color: var(--p); box-shadow: 0 0 0 4px var(--pl), var(--sh); }
.node .k { font-size: 11px; font-weight: 700; letter-spacing: .06em; text-transform: uppercase; color: var(--mu); }
.node b { display: block; font-size: 14px; }
.node .d { font-size: 12.5px; color: var(--t2); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.node .st { margin-left: auto; width: 24px; height: 24px; border-radius: 50%; display: grid; place-items: center; flex: none; }
.node .st svg { width: 14px; height: 14px; stroke-width: 3; }
.node.run { border-color: var(--info); box-shadow: 0 0 0 4px var(--infol); }
.node.run .st { border: 2.5px solid var(--infol); border-top-color: var(--info); animation: spin .7s linear infinite; }
.node.ok { border-color: var(--ok); }
.node.ok .st { background: var(--ok); color: #fff; }
.node.bad { border-color: var(--err); }
.node.bad .st { background: var(--err); color: #fff; }
.node.skip { opacity: .5; }
.node .ms { position: absolute; right: 14px; bottom: -9px; font: 600 10.5px 'JetBrains Mono', monospace; background: var(--ok); color: #fff; padding: 1px 6px; border-radius: 6px; }
.node .del { position: absolute; top: -9px; right: -9px; width: 22px; height: 22px; border-radius: 50%; border: 1px solid var(--line2); background: var(--bg2); color: var(--mu); display: none; place-items: center; cursor: pointer; padding: 0; }
.node:hover .del, .node.sel .del { display: grid; }
@media (hover: none) { .node .del { display: grid; } }
.node .del svg { width: 12px; height: 12px; }
.trig-badge { position: absolute; top: -11px; left: 16px; background: var(--p); color: #fff; font-size: 10.5px; font-weight: 700; letter-spacing: .06em; padding: 2px 8px; border-radius: 999px; text-transform: uppercase; }
.link { width: 2px; height: 46px; background: var(--line2); position: relative; display: flex; justify-content: center; align-items: center; }
.link.flow::after { content: ''; position: absolute; top: 0; left: -2px; width: 6px; height: 12px; border-radius: 4px; background: var(--p2); animation: pulse-down .7s linear; }
@keyframes pulse-down { from { top: 0; opacity: 1; } to { top: 100%; opacity: 0; } }
.link .add { width: 26px; height: 26px; border-radius: 50%; border: 1.5px solid var(--line2); background: var(--bg2); color: var(--t2); display: grid; place-items: center; cursor: pointer; padding: 0; position: relative; z-index: 2; transition: .15s; }
.link .add:hover { border-color: var(--p); color: #fff; background: var(--p); transform: scale(1.1); }
.link .add svg { width: 14px; height: 14px; stroke-width: 2.5; }
.end { margin-top: 0; display: flex; flex-direction: column; align-items: center; gap: 8px; }
.end .addbig { border: 2px dashed var(--line2); background: var(--bg2); color: var(--t2); padding: 10px 18px; border-radius: 12px; font-weight: 600; cursor: pointer; display: flex; gap: 8px; align-items: center; }
.end .addbig:hover { border-color: var(--p); color: var(--p); }
.cond-tag { font-size: 11.5px; font-weight: 600; color: var(--warn); background: var(--warnl); padding: 2px 8px; border-radius: 999px; margin: 6px 0 0; }

.panel { position: sticky; top: 0; display: grid; gap: 14px; }
.panel .card-b label.f { margin-bottom: 12px; }
.vars { display: flex; gap: 6px; flex-wrap: wrap; margin-top: 4px; }
.vars button { border: 1px dashed var(--line2); background: var(--s2); border-radius: 7px; font: 500 11.5px 'JetBrains Mono', monospace; padding: 3px 7px; cursor: pointer; color: var(--t2); }
.vars button:hover { border-color: var(--p); color: var(--p); }
.log { background: #0B1020; color: #C9D1E8; border-radius: 12px; padding: 12px 14px; font: 12px/1.65 'JetBrains Mono', ui-monospace, monospace; max-height: 260px; overflow-y: auto; }
.log .t { color: #6B7699; } .log .g { color: #34D399; } .log .r { color: #F87171; } .log .y { color: #FBBF24; } .log .b { color: #93C5FD; }
.log:empty::before { content: 'Press “Test run” to see each step execute…'; color: #6B7699; }

/* result preview */
.phone { border-radius: 26px; background: #111827; padding: 10px; box-shadow: var(--sh2); max-width: 300px; margin: 0 auto; }
.phone .scr { border-radius: 18px; overflow: hidden; background: #E5DDD5; background-image: radial-gradient(rgba(0,0,0,.05) 1px, transparent 1px); background-size: 12px 12px; min-height: 200px; }
.phone .wh { background: #075E54; color: #fff; padding: 10px 12px; display: flex; gap: 10px; align-items: center; font-size: 13px; }
.phone .wh .av { width: 30px; height: 30px; font-size: 11px; }
.phone .msgs { padding: 12px; display: flex; flex-direction: column; gap: 8px; }
.phone .bub { background: #fff; color: #111; padding: 8px 10px; border-radius: 0 10px 10px 10px; font-size: 12.5px; max-width: 90%; box-shadow: 0 1px 1px rgba(0,0,0,.1); white-space: pre-wrap; animation: tin .35s var(--ease); }
.phone .bub small { display: block; text-align: right; color: #8696A0; font-size: 10px; margin-top: 2px; }
.phone .bub .doc { display: flex; gap: 8px; align-items: center; background: #F0F2F5; border-radius: 8px; padding: 8px; margin-bottom: 6px; }
.phone .bub .doc i { width: 28px; height: 34px; background: #F04438; border-radius: 4px; color: #fff; font: 700 9px Inter; display: grid; place-items: center; font-style: normal; }
.sheet { border: 1px solid var(--line); border-radius: 10px; overflow: hidden; font-size: 12px; }
.sheet table { width: 100%; border-collapse: collapse; }
.sheet th { background: #E8F5EE; color: #0F5132; font-weight: 600; text-align: left; padding: 6px 8px; }
[data-theme="dark"] .sheet th { background: rgba(16,185,129,.15); color: #6EE7B7; }
.sheet td { padding: 6px 8px; border-top: 1px solid var(--line); white-space: nowrap; }
.sheet tr.new td { background: var(--okl); animation: tin .4s var(--ease); }
.res-tabs { display: flex; gap: 6px; margin-bottom: 12px; flex-wrap: wrap; }
.res-tabs button { border: 1px solid var(--line); background: var(--bg2); border-radius: 999px; padding: 4px 11px; font-size: 12.5px; font-weight: 600; cursor: pointer; color: var(--t2); display: flex; gap: 6px; align-items: center; }
.res-tabs button.on { background: var(--t); color: var(--bg2); border-color: var(--t); }

/* pickers */
.apps-grid { display: grid; grid-template-columns: repeat(2, 1fr); gap: 8px; }
.apps-grid button { display: flex; gap: 10px; align-items: center; text-align: left; border: 1px solid var(--line); background: var(--bg2); border-radius: 12px; padding: 10px; cursor: pointer; transition: .15s; }
.apps-grid button:hover { border-color: var(--p); background: var(--pl); }
.apps-grid b { font-size: 13px; display: block; } .apps-grid small { font-size: 11.5px; color: var(--mu); }

/* templates */
.tpl { padding: 18px; display: flex; flex-direction: column; gap: 12px; }
.tpl h3 { font-size: 15.5px; }
.tpl p { margin: 0; color: var(--t2); font-size: 13px; flex: 1; }
.tpl .save { font-size: 12px; font-weight: 600; color: var(--ok); display: flex; gap: 6px; align-items: center; }
.tpl .ind { font-size: 11px; font-weight: 700; letter-spacing: .06em; text-transform: uppercase; color: var(--mu); }

/* run status */
.rs { display: inline-flex; align-items: center; gap: 6px; font-size: 12.5px; font-weight: 600; }
.rs::before { content: ''; width: 8px; height: 8px; border-radius: 50%; }
.rs.ok { color: var(--ok); } .rs.ok::before { background: var(--ok); }
.rs.bad { color: var(--err); } .rs.bad::before { background: var(--err); }
.rs.run { color: var(--info); } .rs.run::before { background: var(--info); animation: lp 1.2s infinite; }
.steps-mini { display: flex; gap: 3px; }
.steps-mini i { width: 16px; height: 6px; border-radius: 3px; background: var(--ok); }
.steps-mini i.bad { background: var(--err); } .steps-mini i.skip { background: var(--s3); }

.hero-auto { position: relative; overflow: hidden; padding: 22px 24px; background: radial-gradient(80% 120% at 0% 0%, rgba(16,185,129,.22), transparent 60%), radial-gradient(70% 120% at 100% 100%, rgba(99,102,241,.2), transparent 60%), var(--s1); }
.hero-auto h2 { font-size: 22px; }
.hero-auto p { margin: 6px 0 0; color: var(--t2); max-width: 560px; }
.hero-auto .big { font: 800 40px Manrope, Inter, sans-serif; letter-spacing: -.02em; background: linear-gradient(90deg, #059669, #6366F1); -webkit-background-clip: text; background-clip: text; color: transparent; }

@media (max-width: 1100px) { .bld { grid-template-columns: 1fr; } .panel { position: static; } }
@media (max-width: 560px) { .apps-grid { grid-template-columns: 1fr; } .canvas { padding: 30px 12px 50px; } .hero-auto .big { font-size: 30px; } }
.bld > *, .grid > * { min-width: 0; }
@media (max-width: 900px) {
  .top .live { display: none; }
  .top [data-newwf] { margin-left: auto !important; }
}
@media (max-width: 560px) {
  .top [data-newwf] span { display: none; }
  .top [data-newwf] { width: 38px; padding: 0; }
  .hero-auto .row { flex-direction: column; align-items: flex-start !important; }
  .hero-auto .row > div[style] { text-align: left !important; }
  .tplg { grid-template-columns: 1fr !important; }
  .bld-head .nm { width: 100%; max-width: none; }
}
