/* "Build by chatting" demo: the prompt is typed, then a small CRM assembles itself
   step by step and goes live. Phases are set on .motion-build by feature-motion.js. */
.motion-build{background:#eff9fa;border-color:#e4f4f4}
.bm{gap:16px;justify-content:center;font-size:13px;line-height:18px}

/* Chat: prompt bubble and agent status line. */
.bm-chat{display:flex;flex-direction:column;gap:10px}
.bm-prompt{align-self:flex-end;max-width:85%;padding:11px 16px;background:#d6f2f5;color:#24464b;border:1px solid #bce5eb;border-radius:16px 16px 4px 16px;font-size:15px;line-height:22px;white-space:nowrap}
.motion-build[data-phase=intro] .bm-typed{animation:bm-type .75s steps(29,end) both}
.motion-build[data-phase=intro] .bm-prompt:after{content:'';display:inline-block;width:1.5px;height:16px;margin-left:2px;vertical-align:-3px;background:#24464b;animation:bm-caret .5s steps(1) infinite}
.bm-status{align-self:flex-start;display:flex;align-items:center;gap:9px;padding:7px 12px 7px 9px;background:#fff;border:1px solid #dde4dc;border-radius:999px;color:#525b4d;box-shadow:0 4px 12px #22341905}
.motion-build[data-phase=intro] .bm-status{animation:bm-rise .35s .85s both}
.bm-icon{width:18px;height:18px;flex-shrink:0;border-radius:50%;display:grid;place-items:center;background:#e4f2e6;color:#648d67}
.bm-icon svg{width:12px;height:12px}
.motion-build:not([data-phase=ready]) .bm-status .bm-icon{background:transparent;border:2px solid #dce9dc;border-top-color:#648d67;animation:demo-spin .8s linear infinite}
.motion-build:not([data-phase=ready]) .bm-status svg{visibility:hidden}
.bm-steps{display:flex;gap:4px;margin-left:4px}
.bm-steps i{width:14px;height:4px;border-radius:2px;background:#e3e8e1;transition:background .3s}
.bm-steps i.is-on{background:#8fc493}
.bm-steps i.is-current{background:#77e2ef}

/* App window. */
.bm-window{position:relative;background:#fff;border:1px solid #dde4dc;border-radius:14px;box-shadow:0 10px 30px #1e3a3f0f;overflow:hidden}
.bm-bar{display:flex;align-items:center;gap:10px;padding:9px 12px;border-bottom:1px solid #edf0eb;background:#fafbf9}
.bm-dots{display:flex;gap:5px}.bm-dots i{width:8px;height:8px;border-radius:50%;background:#e2e5df}
.bm-url{flex:1;min-width:0;display:flex;align-items:center;gap:7px;padding:4px 10px;background:#fff;border:1px solid #edf0eb;border-radius:7px;color:#8a8f86;font-size:12px}
.bm-url-text{overflow:hidden;text-overflow:ellipsis;white-space:nowrap}
.bm-live-dot{width:7px;height:7px;flex-shrink:0;border-radius:50%;background:#d7dbd4;transition:background .3s,box-shadow .3s}
.bm-live-label{margin-left:auto;padding:1px 7px;border-radius:999px;background:#e4f2e6;color:#4f7c53;font-size:11px;font-weight:600;opacity:0;transition:opacity .3s}
.motion-build[data-phase=ready] .bm-live-dot{background:#5fbf6a;box-shadow:0 0 0 3px #5fbf6a2e}
.motion-build[data-phase=ready] .bm-live-label{opacity:1}
.motion-build[data-phase=ready] .bm-url{color:#3d453a}
.bm-publish{padding:4px 11px;border-radius:7px;background:#242823;color:#fff;font-size:12px;font-weight:500;transition:transform .15s,background .3s}
.motion-build[data-phase=publish] .bm-publish{animation:bm-press .35s .25s both;background:#4d554a}
.motion-build[data-phase=ready] .bm-publish{background:#e4f2e6;color:#4f7c53}
.bm-url{position:relative;overflow:hidden}
.motion-build[data-phase=publish] .bm-url:before{content:'';position:absolute;left:0;bottom:0;height:2px;background:#77e2ef;animation:bm-load 1s .35s ease-in-out both}

.bm-body{display:grid;grid-template-columns:124px 1fr;height:236px}
.bm-nav{display:flex;flex-direction:column;gap:3px;padding:12px 10px;border-right:1px solid #edf0eb;background:#fcfdfc}
.bm-nav b{display:flex;align-items:center;gap:7px;margin:0 4px 9px;font-size:12px;color:#242823}
.bm-logo{width:14px;height:14px;border-radius:4px;background:#77e2ef;box-shadow:-2px -2px 0 #bff0f5}
.bm-nav-item{padding:5px 8px;border-radius:7px;color:#72746f;font-size:12px;opacity:0;transform:translateX(-6px);transition:opacity .3s,transform .3s,background .2s,color .2s}
.bm-nav-item.is-on{opacity:1;transform:none}
.bm-nav-item.is-active{background:#eaf6f7;color:#24464b;font-weight:500}

.bm-views{position:relative;min-width:0}
.bm-view{position:absolute;inset:0;padding:12px 14px;opacity:0;visibility:hidden;transition:opacity .25s,visibility 0s .25s}
.bm-view.is-active{opacity:1;visibility:visible;transition:opacity .25s}
.bm-head{display:flex;align-items:baseline;gap:8px;margin-bottom:8px;font-size:14px;font-weight:600;color:#242823}
.bm-head small{font-size:11px;font-weight:400;color:#8a8f86}

/* Skeleton shown while planning. */
.bm-empty{display:flex;flex-direction:column;gap:10px;padding-top:16px}
.bm-empty i{height:12px;border-radius:6px;background:linear-gradient(90deg,#f1f3ef 0,#f8faf7 50%,#f1f3ef 100%);background-size:200% 100%;animation:bm-shimmer 1.2s linear infinite}
.bm-empty i:nth-child(1){width:38%;height:14px}.bm-empty i:nth-child(2){width:92%}.bm-empty i:nth-child(3){width:84%}.bm-empty i:nth-child(4){width:70%}

/* Contacts and team rows. */
.bm-row{display:grid;grid-template-columns:24px minmax(0,1fr) minmax(0,.9fr) auto;align-items:center;gap:9px;padding:6px 0;border-top:1px solid #f1f3ef;color:#525b4d;font-size:12px}
.bm-row b{font-weight:500;color:#242823;overflow:hidden;text-overflow:ellipsis;white-space:nowrap}
.bm-av{width:24px;height:24px;border-radius:50%;display:grid;place-items:center;background:color-mix(in srgb,var(--c) 32%,#fff);color:#3b4238;font-size:9.5px;font-weight:600}
.bm-co{color:#8a8f86;overflow:hidden;text-overflow:ellipsis;white-space:nowrap}
.bm-tag,.bm-role{padding:2px 8px;border-radius:999px;background:#eaf6f7;color:#2d666f;font-size:11px;white-space:nowrap}
.bm-tag-warm{background:#fff1e4;color:#9a5a24}
.bm-team .bm-row{grid-template-columns:24px minmax(0,1fr) auto auto}
.bm-role{background:#f2edfb;color:#6a4fa0}
.bm-perm{position:relative;width:26px;height:15px;border-radius:999px;background:#e3e6e0}
.bm-perm:after{content:'';position:absolute;top:2px;left:2px;width:11px;height:11px;border-radius:50%;background:#fff;box-shadow:0 1px 2px #0002}
.bm-perm.is-allowed{background:#8fc493}.bm-perm.is-allowed:after{left:13px}
.bm-view.is-active .bm-row{animation:bm-rise .35s both}
.bm-view.is-active .bm-row:nth-of-type(2){animation-delay:.2s}
.bm-view.is-active .bm-row:nth-of-type(3){animation-delay:.4s}
.bm-view.is-active .bm-row:nth-of-type(4){animation-delay:.6s}
.bm-view.is-active .bm-row:nth-of-type(5){animation-delay:.8s}
.motion-build[data-phase=rbac] .bm-team .bm-perm{animation:bm-pop .3s both}
.motion-build[data-phase=rbac] .bm-team .bm-row:nth-of-type(2) .bm-perm{animation-delay:.6s}
.motion-build[data-phase=rbac] .bm-team .bm-row:nth-of-type(3) .bm-perm{animation-delay:.8s}
.motion-build[data-phase=rbac] .bm-team .bm-row:nth-of-type(4) .bm-perm{animation-delay:1s}

/* Pipeline board. */
.bm-board{display:grid;grid-template-columns:repeat(3,minmax(0,1fr));gap:8px}
.bm-col{display:flex;flex-direction:column;gap:6px;min-height:150px;padding:7px;border-radius:9px;background:#f6f8f5}
.bm-col-title{font-size:11px;font-weight:500;color:#8a8f86;padding:0 2px}
.bm-col-won{background:#eef7ef}.bm-col-won .bm-col-title{color:#4f7c53}
.bm-card{display:flex;flex-direction:column;gap:1px;padding:7px 8px;border:1px solid #e6e9e3;border-radius:7px;background:#fff;box-shadow:0 1px 2px #2234190a;font-size:11px;color:#8a8f86}
.bm-card b{font-weight:500;font-size:12px;color:#242823;overflow:hidden;text-overflow:ellipsis;white-space:nowrap}
.bm-card span{font-variant-numeric:tabular-nums}
.motion-build[data-phase=opportunities] .bm-card{animation:bm-drop .4s both}
.motion-build[data-phase=opportunities] .bm-col:nth-child(1) .bm-card:nth-of-type(2){animation-delay:.45s}
.motion-build[data-phase=opportunities] .bm-col:nth-child(2) .bm-card{animation-delay:.2s}
.motion-build[data-phase=opportunities] .bm-col:nth-child(3) .bm-card{animation-delay:.65s}

/* Ready toast. */
.bm-toast{position:absolute;right:14px;bottom:14px;display:flex;align-items:center;gap:9px;padding:9px 10px 9px 11px;background:#242823;color:#fff;border-radius:12px;box-shadow:0 12px 28px #1b26202e;font-size:13px;font-weight:500;white-space:nowrap;opacity:0;transform:translateY(10px) scale(.97);transform-origin:bottom right;transition:opacity .35s,transform .35s cubic-bezier(.2,.9,.3,1.2)}
.bm-toast .bm-icon{background:#5fbf6a;color:#fff}
.bm-open{margin-left:6px;padding:3px 9px;border-radius:7px;background:#ffffff1f;color:#d6f2f5;font-weight:400;font-size:12px}
.motion-build[data-phase=ready] .bm-toast{opacity:1;transform:none;transition-delay:.25s}

@keyframes bm-type{from{clip-path:inset(0 100% 0 0)}to{clip-path:inset(0 0 0 0)}}
@keyframes bm-caret{50%{opacity:0}}
@keyframes bm-rise{from{opacity:0;transform:translateY(6px)}}
@keyframes bm-drop{from{opacity:0;transform:translateY(-10px) scale(.96)}}
@keyframes bm-pop{from{transform:scale(.6);opacity:0}}
@keyframes bm-press{50%{transform:scale(.92)}}
@keyframes bm-load{from{width:0}to{width:100%}}
@keyframes bm-shimmer{to{background-position:-200% 0}}

@container feature-demo (max-width:440px){
 .bm-body{grid-template-columns:1fr}
 .bm-nav{display:none}
 .bm-prompt{font-size:14px;padding:10px 14px}
 .bm-co{display:none}
 .bm-row{grid-template-columns:24px minmax(0,1fr) auto}
 .bm-team .bm-row{grid-template-columns:24px minmax(0,1fr) auto auto}
 .bm-dots{display:none}
 .bm-steps{display:none}
 .bm-board{gap:6px}
 .bm-col{padding:5px}
 .bm-card{padding:6px}
 .bm-card b{font-size:11px}
 .bm-open{display:none}
 .bm-toast{right:10px;bottom:10px;font-size:12px}
}
