/* FlowBiz landing — hero sống: người giao việc ⇄ FlowBiz AI Agent (assets/hero.js). Chỉ transform/opacity (+ blur cho chiều sâu). */
.hero-vis { position: relative; width: 100%; max-width: 560px; margin: 0 auto; }
.hx { --px: 0; --py: 0; position: relative; height: 580px; font-size: 12px; line-height: 1.35; user-select: none; }
.hx-l2, .hx-l3 { position: absolute; inset: 0; transition: translate .5s ease-out; }
.hx-l2 { z-index: 1; translate: calc(var(--px) * -6px) calc(var(--py) * -5px); }
.hx-l3 { z-index: 3; translate: calc(var(--px) * 10px) calc(var(--py) * 8px); }
.hx-svg { position: absolute; inset: 0; width: 100%; height: 100%; overflow: visible; }
.hx-glow { position: absolute; left: 50%; top: 146px; width: 440px; height: 440px; margin: -220px 0 0 -220px; border-radius: 50%; pointer-events: none;
  background: radial-gradient(circle, rgba(124, 58, 237, .30), rgba(58, 111, 240, .14) 42%, transparent 68%); }

/* lines + data particles */
.hx-ln { fill: none; stroke-width: 1.6; stroke-linecap: round; stroke-dasharray: 4 6; opacity: .8; transition: opacity .5s ease; }
.hx-ln.to-card { stroke-dasharray: 2 5; opacity: .6; }
.hx-ln.gone { opacity: 0; }
.hx-pt { filter: drop-shadow(0 0 4px currentColor); }

/* human prompt */
.hx-pill { position: absolute; z-index: 4; top: 0; left: 0; right: 50px; display: flex; align-items: flex-start; gap: 10px; padding: 10px 12px; border-radius: 16px;
  background: var(--surface); color: var(--text); border: 1px solid rgba(255, 255, 255, .16); box-shadow: 0 22px 48px -18px rgba(6, 12, 32, .7); }
.hx-pill .av, .hx-pt { transition: opacity .16s ease; }
.hx-pill.swap .av, .hx-pill.swap .hx-pt { opacity: 0; }
.hx-pt { flex: 1; min-width: 0; }
.hx-pt small { display: block; color: var(--muted); font-size: 11px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.hx-pt p { margin: 2px 0 0; min-height: 2.7em; font-size: 13.5px; font-weight: 500; line-height: 1.35; }
html:lang(ja) .hx-pt p { font-size: 13px; }
.hx-caret { display: none; width: 2px; height: 1.05em; margin-left: 1px; vertical-align: -2px; background: var(--primary); }
.typing .hx-caret { display: inline-block; }
.hx-send { width: 28px; height: 28px; border-radius: 50%; display: grid; place-items: center; flex: none; align-self: center; background: var(--surface-3); color: var(--muted); transition: background .2s ease, color .2s ease; }
.hx-send svg.i { width: 15px; height: 15px; }
.sent .hx-send { background: var(--primary); color: var(--primary-ink); }

/* FlowBiz AI Agent core */
.hx-core { position: absolute; left: 50%; top: 104px; width: 200px; margin-left: -100px; display: flex; flex-direction: column; align-items: center; text-align: center; color: #fff; }
.hx-orb { position: relative; width: 84px; height: 84px; }
.hx-f { position: absolute; inset: 0; border-radius: 26px; display: grid; place-items: center; background: linear-gradient(135deg, #527DFF, #24C8CC);
  box-shadow: 0 0 0 1px rgba(255, 255, 255, .22) inset, 0 16px 40px -8px rgba(124, 58, 237, .65); transition: box-shadow .4s ease; }
.hx-f svg { width: 72%; height: 72%; }
.c-done .hx-f { box-shadow: 0 0 0 1px rgba(255, 255, 255, .22) inset, 0 0 0 6px rgba(74, 222, 128, .22), 0 16px 40px -8px rgba(34, 197, 94, .55); }
.hx-ring { position: absolute; border-radius: 50%; pointer-events: none; }
.hx-ring.r1 { inset: -16px; border: 1px dashed rgba(169, 200, 255, .38); }
.hx-ring.r2 { inset: -24px; padding: 2px; opacity: .35; transition: opacity .4s ease;
  background: conic-gradient(from 0deg, transparent 0 62%, #78a9ff 84%, #c4b5fd 100%);
  -webkit-mask: linear-gradient(#000 0 0) content-box, linear-gradient(#000 0 0); -webkit-mask-composite: xor; mask: linear-gradient(#000 0 0) content-box exclude, linear-gradient(#000 0 0); }
.c-work .r2, .c-listen .r2 { opacity: 1; }
.c-wait .r2 { opacity: .7; background: conic-gradient(from 0deg, transparent 0 62%, #fbbf24 84%, #fde68a 100%); }
.hx-orb::after { content: ""; position: absolute; inset: 0; border-radius: 26px; border: 2px solid rgba(169, 200, 255, .55); opacity: 0; pointer-events: none; }
.hx-cl { margin-top: 30px; display: grid; justify-items: center; gap: 4px; }
.hx-cl b { font-size: 12.5px; font-weight: 600; letter-spacing: .01em; }
.hx-st { display: inline-flex; align-items: center; gap: 6px; height: 20px; padding: 0 9px; border-radius: 999px; font-size: 11px; font-weight: 500; white-space: nowrap;
  background: rgba(255, 255, 255, .1); color: #d6e3ff; border: 1px solid rgba(255, 255, 255, .14); }
.hx-st i { width: 6px; height: 6px; border-radius: 50%; background: #a9c8ff; }
.hx-st.s-work i { background: #78a9ff; } .hx-st.s-wait i { background: #fbbf24; } .hx-st.s-done i { background: #4ade80; }
.hx-st.s-wait { color: #fde68a; } .hx-st.s-done { color: #bbf7d0; }

/* app modules dock */
.hx-dock { position: absolute; left: 0; right: 0; top: 284px; display: flex; justify-content: center; gap: 12px; }
.hx-m { position: relative; display: grid; justify-items: center; }
.hx-m .ms { width: 32px; height: 32px; background: rgba(255, 255, 255, .08); color: rgba(255, 255, 255, .55); box-shadow: inset 0 0 0 1px rgba(255, 255, 255, .14);
  transition: transform .35s cubic-bezier(.2, .8, .2, 1), background .3s ease, color .3s ease, box-shadow .3s ease; }
.hx-m small { position: absolute; top: 37px; left: 50%; transform: translate(-50%, -3px); white-space: nowrap; font-size: 10.5px; font-weight: 500; color: #fff; opacity: 0; transition: opacity .3s ease, transform .3s ease; text-shadow: 0 1px 6px rgba(6, 12, 32, .8); }
.hx-m:nth-child(even) small { top: auto; bottom: 37px; transform: translate(-50%, 3px); }
.hx-m.on .ms { background: var(--c); color: #fff; transform: scale(1.14); box-shadow: 0 0 0 4px color-mix(in srgb, var(--c) 30%, transparent), 0 0 22px color-mix(in srgb, var(--c) 70%, transparent); }
.hx-m.on small { opacity: 1; transform: translate(-50%, 0); }
.m-crm { --c: #E5483D; } .m-hrm { --c: #2F6FE4; } .m-erp { --c: #1E88E5; } .m-stock { --c: #D9822B; } .m-acc { --c: #22A06B; } .m-proj { --c: #F08C2B; } .m-appr { --c: #16A37F; }

/* product cards (bản sao thành phần thật) */
.hc { position: absolute; width: 39%; padding: 10px 12px; border-radius: 14px; background: var(--surface); color: var(--text); border: 1px solid var(--border);
  box-shadow: 0 26px 52px -20px rgba(6, 12, 32, .7); opacity: 0; filter: blur(10px);
  transform: translate(var(--fx, 0), var(--fy, 0)) scale(.5);
  transition: opacity .5s ease, transform .65s cubic-bezier(.2, .8, .2, 1), filter .5s ease; }
.hc.in { opacity: 1; filter: none; transform: rotate(var(--rot, 0deg)); }
.hc.dim { opacity: .5; filter: blur(1.5px); transform: rotate(var(--rot, 0deg)) scale(.96); }
.hc.out { opacity: 0; filter: blur(8px); transform: rotate(var(--rot, 0deg)) translateY(-16px) scale(.9); }
.s0 { left: 0; top: 84px; width: 36%; --rot: -2deg; }
.s1 { right: 0; top: 100px; --rot: 2deg; }
.s2 { right: 0; top: 372px; --rot: 1.5deg; }
.sap { left: 0; top: 384px; width: 52%; --rot: -1deg; border-left: 3px solid #f5a524; z-index: 2; }
.hc-h { display: flex; align-items: center; gap: 6px; margin-bottom: 6px; font-size: 11.5px; min-width: 0; }
.hc-h .ms { width: 18px; height: 18px; }
.hc-h b { font-weight: 600; flex: none; }
.hc-h > span:not(.ms) { color: var(--muted); min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.hc-h > span:not(.ms)::before { content: "· "; }
.hl { display: flex; align-items: center; gap: 8px; padding: 6px 0; min-width: 0; }
.hl + .hl { border-top: 1px solid var(--border); }
.hl > div { flex: 1; min-width: 0; }
.hl b, .hl small { display: block; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.hl b { font-weight: 500; font-size: 12px; }
.hl small { color: var(--muted); font-size: 11px; }
.hl .ic-sq { width: 22px; height: 22px; border-radius: 6px; } .hl .ic-sq svg { width: 13px; height: 13px; }
.hc .sc { height: 20px; font-size: 11px; padding: 0 7px; flex: none; max-width: 48%; }
.hc .dt { font-size: 11.5px; flex: none; }
.hc .mn { font-size: 12px; flex: none; white-space: nowrap; }
.hx-mut { color: var(--muted); font-size: 11.5px; white-space: nowrap; flex: none; }
.hc-kpi { display: flex; align-items: center; gap: 10px; min-width: 0; }
.hc-kpi .tile { width: 36px; height: 36px; border-radius: 10px; } .hc-kpi .tile svg { width: 18px; height: 18px; }
.hc-kpi > div { min-width: 0; }
.hc-kpi small { display: block; color: var(--muted); font-size: 11.5px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.hc-kpi strong { font-size: 19px; font-weight: 600; font-variant-numeric: tabular-nums; white-space: nowrap; }
.hc .kc2 { padding: 9px; gap: 7px; box-shadow: none; }
.hc .kc2-t b { font-size: 12.5px; }
.hc .pp { font-size: 11px; line-height: 18px; }
.hcal { display: grid; grid-template-columns: 38px repeat(7, minmax(0, 1fr)); gap: 5px 2px; align-items: center; }
.hcal i { font-style: normal; font-size: 10px; color: var(--muted); text-align: center; }
.hcal > b { font-size: 11.5px; font-weight: 500; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.hcal-t { grid-column: span 7; display: grid; grid-template-columns: repeat(7, minmax(0, 1fr)); height: 16px; border-radius: 4px; background: var(--surface-2); }
.hcal em { height: 16px; border-radius: 4px; }
.hcal em.green { background: color-mix(in srgb, #22c55e 35%, transparent); box-shadow: inset 0 0 0 1px color-mix(in srgb, #22c55e 60%, transparent); }
.hcal em.violet { background: color-mix(in srgb, #8b5cf6 35%, transparent); box-shadow: inset 0 0 0 1px color-mix(in srgb, #8b5cf6 60%, transparent); }
.hcal em.amber { background: color-mix(in srgb, #f59e0b 35%, transparent); box-shadow: inset 0 0 0 1px color-mix(in srgb, #f59e0b 60%, transparent); }
.cs0 { grid-column-start: 1; } .cs1 { grid-column-start: 2; } .cs2 { grid-column-start: 3; } .cs3 { grid-column-start: 4; } .cs4 { grid-column-start: 5; } .cs5 { grid-column-start: 6; } .cs6 { grid-column-start: 7; }
.cl1 { grid-column-end: span 1; } .cl2 { grid-column-end: span 2; } .cl3 { grid-column-end: span 3; } .cl4 { grid-column-end: span 4; } .cl5 { grid-column-end: span 5; }
.hc-f { display: flex; align-items: center; gap: 6px; margin-top: 8px; color: var(--red-fg); font-size: 11.5px; font-weight: 500; }
.hc-f svg.i { width: 13px; height: 13px; flex: none; }
.hk { display: flex; align-items: baseline; gap: 6px; padding: 4px 0; }
.hk + .hk { border-top: 1px solid var(--border); }
.hk small { flex: 1; color: var(--muted); font-size: 11.5px; }
.hk b { font-size: 13px; font-weight: 600; font-variant-numeric: tabular-nums; white-space: nowrap; }
.hk .dl { vertical-align: 0; margin-left: 0; }
.hrl { margin: 6px 0 0; padding-left: 16px; font-size: 11.5px; color: var(--text-2); display: grid; gap: 2px; }
.hrl li::marker { color: var(--red-fg); }
.hb { display: grid; gap: 2px; padding: 3px 0; }
.hb > span { font-size: 11.5px; color: var(--text-2); }
.hc .br span { font-size: 11px; }
.hc .br i b { width: 100%; transform-origin: 0 50%; transform: scaleX(0); transition: transform .8s cubic-bezier(.2, .8, .2, 1) .25s; }
.hc.in .br i b, .hc.dim .br i b { transform: scaleX(var(--w, 0)); }
.hd-to { color: var(--muted); font-size: 11.5px; } .hd-to b { color: var(--text); font-weight: 500; }
.hd-b { margin: 6px 0; font-size: 12px; line-height: 1.45; color: var(--text-2); display: -webkit-box; -webkit-line-clamp: 3; -webkit-box-orient: vertical; overflow: hidden; }
.hd-f { display: flex; align-items: center; gap: 5px; color: var(--violet-fg); font-size: 11px; font-weight: 500; }
.hd-f svg.i { width: 12px; height: 12px; }

/* human approval */
.sap .ap-h > div { flex: 1; min-width: 0; }
.sap .ap-h b, .sap .ap-h small { display: block; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.sap .ap-h b { font-size: 12.5px; font-weight: 600; }
.sap .ap-h small { font-size: 11px; color: var(--muted); }
.sap .wait { flex: none; }
.wait.ok { color: var(--green-fg); background: var(--green-bg); }
.sap p { margin: 8px 0 10px; font-size: 12.5px; font-weight: 500; }
.ap-btns .b.done { display: inline-flex; align-items: center; gap: 4px; background: #16a34a; border-color: #16a34a; color: #fff; }
.ap-btns .b.done svg.i { width: 13px; height: 13px; }
.hx-cur { position: absolute; z-index: 7; left: 0; top: 0; width: 22px; height: 22px; opacity: 0; pointer-events: none;
  transition: transform .75s cubic-bezier(.3, .7, .2, 1), opacity .3s ease; }
.hx-cur.in { opacity: 1; }
.hx-cur svg { width: 22px; height: 22px; fill: #fff; stroke: #16213e; stroke-width: 1.5; stroke-linejoin: round; filter: drop-shadow(0 3px 6px rgba(6, 12, 32, .5)); }
.hx-cur::after { content: ""; position: absolute; left: -10px; top: -10px; width: 24px; height: 24px; border-radius: 50%; background: rgba(120, 169, 255, .55); opacity: 0; transform: scale(.3); }

/* outcome toast */
.hx-toast { position: absolute; z-index: 5; right: 0; top: 508px; width: 46%; display: flex; align-items: center; gap: 10px; padding: 10px 12px; border-radius: 14px;
  background: var(--surface); color: var(--text); border: 1px solid var(--border); box-shadow: 0 22px 48px -16px rgba(6, 12, 32, .75);
  opacity: 0; transform: translateY(-10px) scale(.96); transition: opacity .4s ease, transform .5s cubic-bezier(.2, .8, .2, 1); }
.hx-toast.in { opacity: 1; transform: none; }
.hx-tk { width: 30px; height: 30px; border-radius: 50%; display: grid; place-items: center; flex: none; background: var(--green-bg); color: var(--green-fg); }
.hx-tk svg.i { width: 16px; height: 16px; stroke-width: 2.5; }
.hx-toast > div { min-width: 0; }
.hx-toast b { display: block; font-size: 13px; font-weight: 600; }
.hx-toast small { display: block; font-size: 11px; color: var(--muted); }

/* pause / play (WCAG 2.2.2) */
.hx-pp { position: absolute; z-index: 8; top: 12px; right: 0; width: 36px; height: 36px; border-radius: 50%; display: grid; place-items: center; cursor: pointer;
  background: rgba(255, 255, 255, .1); color: #fff; border: 1px solid rgba(255, 255, 255, .22); }
.hx-pp:hover { background: rgba(255, 255, 255, .18); }
.hx-pp svg.i { width: 15px; height: 15px; }
.hx-pp .i-play, .hx-pp[aria-pressed="true"] .i-pause { display: none; }
.hx-pp[aria-pressed="true"] .i-play { display: block; }
.hx-pp[hidden] { display: none; }

@media (prefers-reduced-motion: no-preference) {
  .hx:not(.hx-rm) .hx-ln { animation: hx-dash 1s linear infinite; }
  .hx:not(.hx-rm) .hx-ring.r1 { animation: hx-spin 24s linear infinite; }
  .hx:not(.hx-rm) .hx-ring.r2 { animation: hx-spin 5s linear infinite; }
  .hx:not(.hx-rm) .c-work .r2, .hx:not(.hx-rm) .c-listen .r2 { animation-duration: 1.2s; }
  .hx:not(.hx-rm) .c-work .hx-orb::after, .hx:not(.hx-rm) .c-listen .hx-orb::after { animation: hx-ping 1.4s ease-out infinite; }
  .hx:not(.hx-rm) .typing .hx-caret { animation: hx-blink 1s steps(1) infinite; }
  .hx:not(.hx-rm) .sent .hx-send { animation: hx-pop .5s ease; }
  .hx:not(.hx-rm) .hx-cur.click::after { animation: hx-ripple .6s ease-out; }
  .hx:not(.hx-rm) .hx-glow { animation: hx-breathe 6s ease-in-out infinite; }
}
.hx.paused *, .hx.paused *::before, .hx.paused *::after { animation-play-state: paused !important; }
.hx.hx-rm *, .hx.hx-rm *::before, .hx.hx-rm *::after { transition: none !important; animation: none !important; }
@media (prefers-reduced-motion: reduce) { .hx *, .hx *::before, .hx *::after { transition: none !important; animation: none !important; } }
@keyframes hx-spin { to { transform: rotate(1turn); } }
@keyframes hx-dash { to { stroke-dashoffset: -20; } }
@keyframes hx-ping { 0% { opacity: .9; transform: scale(1); } 100% { opacity: 0; transform: scale(1.55); } }
@keyframes hx-blink { 50% { opacity: 0; } }
@keyframes hx-pop { 50% { transform: scale(1.25); } }
@keyframes hx-ripple { 0% { opacity: .9; transform: scale(.3); } 100% { opacity: 0; transform: scale(1.8); } }
@keyframes hx-breathe { 50% { opacity: .7; transform: scale(.94); } }

/* phone: lõi + câu lệnh + một thẻ mỗi lúc */
@media (max-width: 639px) {
  .hx { height: 486px; }
  .hx-l3, .hx-l2 { translate: none; }
  .hx-pill { right: 44px; padding: 9px 10px; gap: 8px; }
  .hx-pt p { font-size: 13px; }
  .hx-send { display: none; }
  .hx-pp { top: 10px; width: 34px; height: 34px; }
  .hx-glow { top: 124px; width: 320px; height: 320px; margin: -160px 0 0 -160px; }
  .hx-core { top: 92px; }
  .hx-orb { width: 64px; height: 64px; }
  .hx-f, .hx-orb::after { border-radius: 20px; }
  .hx-ring.r1 { inset: -11px; } .hx-ring.r2 { inset: -17px; }
  .hx-cl { margin-top: 22px; }
  .hx-dock { top: 232px; gap: 7px; }
  .hx-m .ms { width: 28px; height: 28px; }
  .hx-m small { display: none; }
  .hc, .hc.s0, .hc.s1, .hc.s2, .hc.sap { left: 0; right: 0; width: auto; top: 278px; --rot: 0deg; }
  .hx-toast { left: 0; right: 0; width: auto; top: 278px; }
}
