/* Homepage coded loops (storyboard boards 2-4, signed off Nov 11, 2026):
   Transform tab 3 (.t3 Email Templates & Flyers), tab 4 (.t4 Referral Partners) on an 800 x 400 stage,
   and the Predict section's MCP conversation (.mcp-loop). States key off data-step (motion.js). */

/* ---------- Shared: tab panels that hold a loop ---------- */
.pipe-panel--loop { align-items: center; padding: 0 24px; }
.pipe-loop { width: 100%; max-width: 800px; }
.pipe-loop .mstage { height: 400px; color: var(--black); }
.pipe-loop p { margin: 0; }
.pipe-loop svg { display: block; }

/* ---------- Tab 3: email & flyer builder ---------- */
.t3-win { position: absolute; inset: 0; overflow: hidden; border-radius: 16px; background: var(--white); box-shadow: 0 8px 32px rgba(0, 0, 0, .25); }
.t3-top { position: absolute; left: 0; right: 0; top: 0; height: 52px; display: flex; align-items: center; justify-content: space-between; padding: 0 16px; border-bottom: 1px solid var(--n200); }
.t3-toggle { position: relative; display: flex; padding: 3px; border-radius: 999px; background: var(--n100); }
.t3-toggle__pill { position: absolute; left: 3px; top: 3px; width: 64px; height: 26px; border-radius: 999px; background: var(--black); transition: transform .45s cubic-bezier(.2, .7, .2, 1); }
.t3-toggle__opt { position: relative; width: 64px; height: 26px; display: flex; align-items: center; justify-content: center; font-size: 12px; font-weight: 600; color: var(--n600); transition: color .3s; }
.t3-toggle__opt--email { color: var(--white); }
.t3:is([data-step="3"], [data-step="4"]) .t3-toggle__pill { transform: translateX(64px); }
.t3:is([data-step="3"], [data-step="4"]) .t3-toggle__opt--email { color: var(--n600); }
.t3:is([data-step="3"], [data-step="4"]) .t3-toggle__opt--flyer { color: var(--white); }
.t3-save { padding: 7px 14px; border-radius: 8px; background: var(--black); color: var(--white); font-size: 12px; font-weight: 600; }
.t3[data-step="4"] .t3-save { animation: m-press .45s .15s both; }

.t3-rail { position: absolute; left: 0; top: 52px; bottom: 0; width: 140px; box-sizing: border-box; display: flex; flex-direction: column; gap: 8px; padding: 16px 14px; border-right: 1px solid var(--n200); background: var(--n100); }
.t3-rail p, .t3-lib p { margin-bottom: 4px; color: var(--n500); font-size: 11px; font-weight: 600; text-transform: uppercase; letter-spacing: .04em !important; }
.t3-tile { display: flex; align-items: center; gap: 8px; padding: 8px 10px; border: 1px solid var(--n200); border-radius: 8px; background: var(--white); color: var(--n800); font-size: 12px; font-weight: 500; }
.t3-tile svg { color: var(--n500); }
.t3[data-step="1"] .t3-tile { animation: t3-pick .6s var(--d) both; }
.t3 .mloop__toggle:focus-visible { outline-color: var(--black); }   /* lime ring is ~1.1:1 on the white window */
@keyframes t3-pick { 0%, 100% { background: var(--white); border-color: var(--n200); } 30%, 60% { background: var(--lime-100); border-color: var(--lime-500); } }

.t3-canvas { position: absolute; left: 140px; right: 180px; top: 52px; bottom: 0; display: flex; justify-content: center; padding-top: 20px; background: var(--n150); }
.t3-doc { width: 280px; height: fit-content; box-sizing: border-box; display: flex; flex-direction: column; gap: 10px; padding: 12px; border-radius: 8px; background: var(--white); box-shadow: 0 4px 16px rgba(10, 10, 10, .1); transition: width .5s cubic-bezier(.2, .7, .2, 1); }
.t3-b { border-radius: 4px; }
.t3-b--head { height: 30px; display: flex; align-items: center; justify-content: center; background: var(--n200); transition: background-color .4s; }
.t3-b--head span { color: var(--white); font-size: 10px; font-weight: 700; letter-spacing: .08em !important; opacity: 0; transition: opacity .3s; }
.t3-b--img { height: 100px; display: flex; align-items: center; justify-content: center; background: var(--n150); color: var(--n400); transition: height .5s cubic-bezier(.2, .7, .2, 1); }
.t3-b--text { display: flex; flex-direction: column; gap: 6px; }
.t3-b--text i { display: block; height: 6px; border-radius: 3px; background: var(--n200); }
.t3-b--text .t3-h { width: 72%; height: 10px; background: var(--n300); transition: background-color .4s; }
.t3-b--btn { width: 124px; height: 28px; display: flex; align-items: center; justify-content: center; border-radius: 999px; background: var(--n200); transition: background-color .4s; }
.t3-b--btn span { font-size: 11px; font-weight: 600; opacity: 0; transition: opacity .3s; }
.t3-b--lo { display: flex; align-items: center; gap: 8px; max-height: 0; overflow: hidden; opacity: 0; margin-top: -10px; transition: max-height .45s, opacity .3s, margin-top .45s; }
.t3-lo__face { flex: none; width: 26px; height: 26px; border-radius: 50%; background: var(--n800); }
.t3-b--lo span { display: flex; flex-direction: column; gap: 5px; }
.t3-b--lo span i { display: block; height: 5px; border-radius: 3px; background: var(--n300); }
/* brand kit (step 2+) */
.t3:is([data-step="2"], [data-step="3"], [data-step="4"]) .t3-b--head { background: var(--n900); }
.t3:is([data-step="2"], [data-step="3"], [data-step="4"]) .t3-b--head span,
.t3:is([data-step="2"], [data-step="3"], [data-step="4"]) .t3-b--btn span { opacity: 1; }
.t3:is([data-step="2"], [data-step="3"], [data-step="4"]) .t3-b--btn { background: var(--lime); }
.t3:is([data-step="2"], [data-step="3"], [data-step="4"]) .t3-h { background: var(--n800); }
.t3[data-step="2"] :is(.t3-b--head, .t3-b--btn, .t3-h) { transition-delay: .15s; }
/* flyer (step 3+) */
.t3:is([data-step="3"], [data-step="4"]) .t3-doc { width: 236px; }
.t3:is([data-step="3"], [data-step="4"]) .t3-b--img { height: 132px; }
.t3:is([data-step="3"], [data-step="4"]) .t3-b--lo { max-height: 30px; opacity: 1; margin-top: 0; }
.t3-toast { position: absolute; left: 50%; bottom: 16px; display: inline-flex; align-items: center; gap: 8px; margin-left: -96px; width: 192px; justify-content: center; padding: 8px 12px; border-radius: 999px; background: var(--black); color: var(--white); font-size: 12px; font-weight: 600; white-space: nowrap; box-shadow: 0 6px 18px rgba(0, 0, 0, .25); }

.t3-lib { position: absolute; right: 0; top: 52px; bottom: 0; width: 180px; box-sizing: border-box; padding: 16px 14px; border-left: 1px solid var(--n200); }
.t3-thumbs { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 10px; margin-top: 8px; }
.t3-thumb { height: 92px; box-sizing: border-box; display: flex; flex-direction: column; gap: 5px; padding: 6px; border: 1px solid var(--n200); border-radius: 6px; background: var(--white); }
.t3-thumb i { display: block; height: 4px; border-radius: 2px; background: var(--n200); }
.t3-thumb .t3-thumb__h { height: 9px; background: var(--n300); }
.t3-thumb .t3-thumb__img { height: 30px; background: var(--n150); }
.t3-thumb--new { border: 2px solid var(--lime-500); }
.t3-thumb--new .t3-thumb__h { background: var(--n900); }
.t3-thumb--new .t3-thumb__btn { width: 60%; height: 8px; background: var(--lime); }

/* ---------- Tab 4: co-branded flyer, share, landing page, lead ---------- */
.t4-flyer { position: absolute; left: 282px; top: 34px; width: 236px; box-sizing: border-box; display: flex; flex-direction: column; gap: 9px; padding: 12px; border-radius: 10px; background: var(--white); box-shadow: 0 8px 28px rgba(0, 0, 0, .3); }
.t4-flyer__img { height: 118px; display: flex; align-items: center; justify-content: center; border-radius: 6px; background: var(--n150); color: var(--n400); }
.t4-flyer__title { font-size: 16px; line-height: 1.25; font-weight: 700; }
.t4-bar { display: block; height: 6px; border-radius: 3px; background: var(--n200); }
.t4-people { display: flex; justify-content: space-around; margin-top: 6px; padding-top: 10px; border-top: 1px solid var(--n200); }
.t4-person { display: flex; flex-direction: column; align-items: center; gap: 5px; color: var(--n600); font-size: 10px; font-weight: 500; }
.t4-face { width: 40px; height: 40px; display: flex; align-items: center; justify-content: center; border-radius: 50%; }
.t4-face--lo { background: var(--n900); color: var(--lime); }
.t4-face--re { background: var(--lime); color: var(--black); }
.t4-face--sm { width: 26px; height: 26px; }
.t4-face--sm svg { width: 14px; height: 14px; }

.t4-share { position: absolute; left: 420px; top: 72px; width: 280px; box-sizing: border-box; display: flex; flex-direction: column; gap: 8px; padding: 16px; border-radius: 14px; background: var(--white); box-shadow: 0 10px 32px rgba(0, 0, 0, .35); }
.t4-share__title { margin-bottom: 2px !important; font-size: 14px; font-weight: 700; }
.t4-opt { display: flex; align-items: center; justify-content: space-between; padding: 10px 12px; border: 1px solid transparent; border-radius: 8px; background: var(--n100); color: var(--n800); font-size: 12px; font-weight: 500; }
.t4[data-step="2"] .t4-opt--pick { animation: t4-pick .4s .6s both; }
@keyframes t4-pick { to { background: var(--lime-100); border-color: var(--lime-500); } }
.t4-sent { position: absolute; left: 420px; top: 282px; display: inline-flex; align-items: center; gap: 8px; padding: 9px 14px; border: 1px solid var(--n600); border-radius: 999px; background: var(--black); color: var(--white); font-size: 13px; font-weight: 600; }

.t4-page { position: absolute; left: 220px; top: 30px; width: 360px; overflow: hidden; border-radius: 12px; background: var(--white); box-shadow: 0 10px 32px rgba(0, 0, 0, .35); }
.t4-page__chrome { display: flex; align-items: center; gap: 5px; height: 26px; padding: 0 10px; background: var(--n150); }
.t4-page__chrome i { width: 7px; height: 7px; border-radius: 50%; background: var(--n300); }
.t4-page__chrome span { width: 160px; height: 12px; margin-left: 12px; border-radius: 6px; background: var(--white); }
.t4-page__body { display: flex; flex-direction: column; gap: 10px; padding: 16px; }
.t4-page__head { display: flex; align-items: center; gap: 6px; margin-bottom: 4px; }
.t4-page__head p { margin-left: 4px !important; font-size: 16px; font-weight: 700; }
.t4-field { display: flex; flex-direction: column; gap: 4px; }
.t4-field > span { color: var(--n600); font-size: 11px; font-weight: 500; }
.t4-field b { position: relative; height: 32px; display: flex; align-items: center; padding: 0 10px; border: 1px solid var(--n300); border-radius: 6px; font-weight: 400; }
.t4-field em { font-style: normal; color: var(--black); font-size: 13px; }
.t4-field .t4-filled { position: absolute; left: 10px; opacity: 0; }
.t4[data-step="4"] .t4-field .t4-filled { opacity: 1; }
.t4-btn { display: flex; align-items: center; justify-content: center; height: 34px; margin-top: 4px; border-radius: 999px; background: var(--black); color: var(--white); font-size: 13px; font-weight: 600; }
.t4[data-step="3"] .t4-btn { animation: m-press .45s 1.25s both; }
.t4 .t4-flyer, .t4 .t4-page { transition: opacity .4s ease, transform .55s cubic-bezier(.2, .7, .2, 1), left .6s cubic-bezier(.2, .7, .2, 1); }
.t4[data-step="2"] .t4-flyer { left: 150px; }
.t4[data-step="4"] .t4-page { left: 70px; opacity: .45; }

.t4-notif { position: absolute; left: 470px; top: 40px; width: 290px; box-sizing: border-box; padding: 12px 14px; border: 1px solid var(--n600); border-radius: 12px; background: var(--black); color: var(--white); }
.t4-notif__app { color: var(--n400); font-size: 10px; font-weight: 600; letter-spacing: .03em !important; }
.t4-notif__title { margin-top: 3px !important; font-size: 13px; font-weight: 600; }
.t4-report { position: absolute; left: 470px; top: 128px; width: 290px; box-sizing: border-box; padding: 10px 12px; border-radius: 12px; background: var(--white); }
.t4-report__row { display: flex; justify-content: space-between; align-items: center; padding: 8px; border-radius: 6px; font-size: 13px; }
.t4-report__row--head { padding-block: 4px 8px; border-bottom: 1px solid var(--n200); border-radius: 0; color: var(--n600); font-size: 11px; font-weight: 600; }
.t4-report__row--hit { margin-top: 4px; }
.t4[data-step="4"] .t4-report__row--hit { animation: t4-hit .5s 1.1s both; }
@keyframes t4-hit { to { background: var(--lime-200); font-weight: 600; } }
.t4-count { position: relative; display: inline-block; width: 14px; height: 18px; text-align: right; }
.t4-count > span { position: absolute; right: 0; top: 0; }
.t4-count__new { opacity: 0; }
.t4[data-step="4"] .t4-count__old { animation: t4-out .3s 1.1s both; }
.t4[data-step="4"] .t4-count__new { animation: t4-in .3s 1.1s both; }
@keyframes t4-out { to { opacity: 0; transform: translateY(-8px); } }
@keyframes t4-in { from { opacity: 0; transform: translateY(8px); } to { opacity: 1; transform: none; } }

@keyframes m-press { 0%, 100% { transform: scale(1); } 40% { transform: scale(.92); } }

/* ---------- Predict section: MCP conversation loop ---------- */
.mcp-loop__head { display: flex; align-items: center; gap: 10px; width: 100%; min-height: 30px; padding: 0 44px 12px 4px; margin-bottom: 8px; border-bottom: 1px solid rgba(255, 255, 255, .08); }
.mcp-loop__app { color: var(--n300); font-size: 14px; font-weight: 600; }
.mcp-loop__conn { display: inline-flex; align-items: center; gap: 6px; padding: 3px 10px; border: 1px solid var(--lime); border-radius: 999px; color: var(--lime); font-size: 12px; font-weight: 500; line-height: 1.5; }
.mcp-loop__conn i { width: 6px; height: 6px; border-radius: 50%; background: var(--lime); }
.mcp-loop__scenes {
  position: relative; flex: 1 1 auto; width: 100%; min-height: 420px; overflow: hidden;
  -webkit-mask-image: linear-gradient(transparent, #000 32px); mask-image: linear-gradient(transparent, #000 32px);
}
.mcp-scene { position: absolute; left: 0; right: 0; bottom: 4px; display: flex; flex-direction: column; align-items: flex-start; }
.mcp-loop .cowork-bubble { margin-top: 0; }
.mcp-loop.mloop[data-step="4"] .mcp-scene--3 { opacity: .35; transform: translateY(-150px); transition: opacity .5s ease, transform .6s cubic-bezier(.2, .7, .2, 1); transition-delay: .9s; }
.mcp-loop .cowork-bubble--user { max-width: 85%; }
.mcp-loop .cowork-table { margin-bottom: 4px; }
/* wrap the action instead of cutting it off with an ellipsis (641-1024px the column is only 150-170px wide) */
.mcp-loop .cowork-table__row .cowork-col-action { white-space: normal; }
.cowork-chip--alert { border-color: var(--n300); color: var(--white); }
.cowork-chip--warm { border-color: var(--n500); color: var(--n300); }
.mcp-done { display: flex; flex-wrap: wrap; gap: 8px; padding-left: 16px; }
.mcp-done span { display: inline-flex; align-items: center; gap: 6px; padding: 6px 12px; border-radius: 999px; background: var(--n800); color: var(--white); font-size: 13px; line-height: 1.5; }
.mcp-loop .cowork-input { margin-top: 12px; }
.cowork-input__typed { min-width: 0; overflow: hidden; color: var(--white); font-size: 14px; line-height: 1.5; white-space: nowrap; text-overflow: ellipsis; }
.cowork-input__typed:empty { display: none; }
.cowork-input__typed:not(:empty)::after { content: ""; display: inline-block; width: 1px; height: 16px; margin-left: 2px; vertical-align: -3px; background: var(--lime); }
.cowork-input.is-typing .cowork-input__placeholder { display: none; }
.mcp-loop .mloop__toggle { top: 14px; right: 16px; bottom: auto; width: 30px; height: 30px; }
.mcp-loop .mloop__toggle svg { width: 12px; height: 12px; }

@media (max-width: 768px) {
  .mcp-loop__scenes { min-height: 440px; }   /* scene 1 is ~396px at 641 now that actions wrap */
}
@media (max-width: 640px) {
  .pipe-panel--loop { min-height: 0; padding: 16px 12px; }
  .mcp-loop__scenes { min-height: 520px; }
  .mcp-loop__head { flex-wrap: wrap; }
  /* scene 4 wraps to ~240px on phones, so scene 3 has to move further up to clear it */
  .mcp-loop.mloop[data-step="4"] .mcp-scene--3 { transform: translateY(-264px); }
  /* the 36px control covered a fifth of the ~160px-tall tab stage */
  .pipe-loop .mloop__toggle { right: 6px; bottom: 6px; width: 28px; height: 28px; }
  .pipe-loop .mloop__toggle svg { width: 11px; height: 11px; }
}
@media (max-width: 400px) {
  .mcp-loop__scenes { min-height: 548px; }   /* scene 3 is ~500px tall at 360 */
}
