/* A small motion film: business inputs become one organized workspace. */
.service-scenes-ready .automation-panel .service-scene .scene-flow {
  display: block; padding: 7px; overflow: visible; border: 1px solid #ffffff59;
  border-radius: 30px; background: linear-gradient(135deg,#f5f7e68c,#d5debd33,#ffffff52);
  box-shadow: 0 22px 52px #1e2a1b2b;
}
.service-scenes-ready .automation-panel .scene-flow::before,
.service-scenes-ready .automation-panel .scene-flow::after { content: none; }
.service-scenes-ready .automation-panel:not(.service-scene-pinned) .service-scene .scene-flow { height: clamp(460px,48vw,610px); min-height: 460px; }
.service-scenes-ready .automation-panel.service-scene-pinned .scene-flow { flex: 1 1 0; min-height: 380px; }
.automation-panel .automation-film {
  --af-cycle: 12s; --af-lime: #ddfb4d; position: relative; isolation: isolate;
  display: grid; grid-template-rows: 49px minmax(0,1fr) 49px; width: 100%; height: 100%;
  min-height: 0; overflow: hidden; padding: 0 20px; border: 1px solid #ffffff1f;
  border-radius: 24px; background: radial-gradient(ellipse at 92% 3%,#6175413d,transparent 52%),linear-gradient(155deg,#1c2721,#0d1511 66%,#18251a);
  color: #ecf1e8; cursor: auto; font-family: inherit;
}
.automation-film::before { content: ""; position: absolute; z-index: -1; inset: 10% -20% -35%; background: radial-gradient(ellipse at 50% 60%,#b8df5420,transparent 57%); pointer-events: none; }
.af-topline { display: flex; align-items: center; justify-content: space-between; gap: 10px; border-bottom: 1px solid #ffffff0e; }
.af-eyebrow { font-size: 10px; font-weight: 400; letter-spacing: .025em; color: #bdcbb9; }
.af-pause { display: grid; place-items: center; flex: none; width: 44px; height: 44px; margin-right: -10px; padding: 12px; border: 0; border-radius: 50%; background: transparent; color: #bacab4; cursor: pointer; touch-action: manipulation; }
.af-pause:hover { color: #fff; background: #ffffff08; }
.af-pause:focus-visible { outline: 2px solid var(--af-lime); outline-offset: -5px; }
.af-pause svg { width: 16px; height: 16px; }
.af-stage { position: relative; min-height: 0; width: 100%; }
.af-inputs { position: absolute; inset: 0; z-index: 2; }
.af-input {
  --af-turn: -4deg; --af-fly-x: 145%; --af-fly-y: 100px;
  position: absolute; top: 5%; left: 1%; display: flex; align-items: center; gap: 8px;
  width: 31%; min-width: 0; padding: 10px 9px; border: 1px solid #ffffff24; border-radius: 12px;
  background: linear-gradient(135deg,#2c3c30,#202d25); box-shadow: 0 8px 17px #0002;
  transform: rotate(var(--af-turn));
}
.af-input:nth-child(2) { --af-turn: 2deg; --af-fly-x: 0%; top: 2%; left: 35%; }
.af-input:nth-child(3) { --af-turn: 5deg; --af-fly-x: -145%; top: 6%; left: 68%; }
.af-input:nth-child(4) { --af-turn: -2deg; --af-fly-x: 85%; --af-fly-y: 58px; top: 22%; left: 15%; }
.af-input:nth-child(5) { --af-turn: 3deg; --af-fly-x: -85%; --af-fly-y: 58px; top: 21%; left: 55%; }
.af-input-icon { display: grid; flex: none; place-items: center; width: 28px; height: 28px; border: 1px solid #ffffff0d; border-radius: 9px; background: #f2f6df0c; color: #e2f3c5; }
.af-input-icon svg { width: 15px; height: 15px; }
.af-input:nth-child(2) .af-input-icon { color: #9be9ba; }
.af-input:nth-child(3) .af-input-icon { color: #d5c4fa; }
.af-input:nth-child(4) .af-input-icon { color: #f3d3a4; }
.af-input:nth-child(5) .af-input-icon { color: #b8dce9; }
.af-input-copy { display: grid; gap: 4px; min-width: 0; }
.af-input-copy b { color: #f2f6ef; font-size: 10px; font-weight: 500; line-height: 1.2; white-space: nowrap; }
.af-input-copy small { overflow: hidden; color: #9eae9c; font-size: 8px; font-weight: 400; line-height: 1.2; white-space: nowrap; text-overflow: ellipsis; }
.af-input-dot { flex: none; width: 4px; height: 4px; margin-left: auto; border-radius: 50%; background: #d4f67d; }
.af-connections { position: absolute; z-index: 0; inset: 0; width: 100%; height: 100%; overflow: visible; }
.af-path { fill: none; stroke: #bddb7d26; stroke-width: 1; vector-effect: non-scaling-stroke; }
.af-path.is-output { stroke: #d6f48a70; }
.af-path.is-desktop { display: none; }
.af-signal { fill: #ddfb4d; opacity: 0; }
.af-agent { position: absolute; z-index: 3; top: 35%; left: 50%; display: flex; align-items: center; flex-direction: column; width: 180px; transform: translateX(-50%); }
.af-agent-core { position: relative; z-index: 1; display: grid; place-items: center; width: 66px; height: 66px; border: 1px solid #f4ffb1; border-radius: 21px; background: linear-gradient(145deg,#edff9a,#d1ed3f); box-shadow: inset 0 1px 0 #fff9,0 0 0 6px #d9f7520a,0 14px 40px #d3ee4324; }
.af-agent-core img { display: block; width: 36px; height: 36px; object-fit: contain; }
.af-agent-orbit { position: absolute; top: -12px; left: 50%; width: 90px; height: 90px; border: 1px solid #d2ee5029; border-radius: 30px; transform: translateX(-50%) rotate(12deg); }
.af-agent-orbit::after { content: ""; position: absolute; top: 6px; right: 7px; width: 4px; height: 4px; border-radius: 50%; background: #ddfb4d; box-shadow: 0 0 9px #ddfb4d70; }
.af-agent-title { margin-top: 10px; color: #ecf5e5; font-size: 10px; font-weight: 500; letter-spacing: .01em; }
.af-agent-caption { margin-top: 4px; color: #a7ba9b; font-size: 8px; line-height: 1.3; }
.af-hub { position: absolute; z-index: 2; bottom: 1%; left: 50%; width: 82%; max-width: 470px; padding: 12px 13px 9px; border: 1px solid #ffffffb3; border-radius: 15px; background: linear-gradient(140deg,#ffffff,#edf2e8); color: #223027; box-shadow: 0 22px 40px -12px #0006,0 0 55px -15px #c2e76726; transform: translateX(-50%); }
.af-hub-head { display: flex; align-items: center; gap: 7px; padding-bottom: 10px; }
.af-hub-head > img { width: 20px; height: 17px; object-fit: contain; }
.af-hub-head > b { font-size: 10px; font-weight: 500; letter-spacing: -.02em; }
.af-hub-live { display: inline-flex; align-items: center; gap: 4px; margin-left: auto; padding: 4px 6px; border: 1px solid #d4dfc9; border-radius: 999px; color: #647950; font-size: 7px; }
.af-hub-live::before { content: ""; width: 4px; height: 4px; border-radius: 50%; background: #82a653; }
.af-hub-stats { display: grid; grid-template-columns: repeat(3,minmax(0,1fr)); gap: 7px; padding-bottom: 9px; }
.af-hub-stats > div { display: flex; align-items: baseline; justify-content: space-between; gap: 4px; padding: 7px 8px; border: 1px solid #dfe7d7; border-radius: 8px; background: #f4f7ef; }
.af-hub-stats b { color: #2e4029; font-size: 15px; font-weight: 500; line-height: 1; }
.af-hub-stats span,.af-hub-stats small { color: #7a8771; font-size: 7px; }
.af-hub-rows { display: grid; gap: 0; }
.af-hub-row { display: flex; align-items: center; gap: 8px; min-height: 31px; border-top: 1px solid #dbe2d57d; }
.af-row-icon { display: grid; flex: none; place-items: center; width: 22px; height: 22px; border-radius: 7px; background: #e2edcf; color: #657e4b; font-size: 9px; }
.af-hub-row:nth-child(2) .af-row-icon { background: #e9e1f1; color: #8b72a2; }
.af-hub-row:nth-child(3) .af-row-icon { background: #f2e6d5; color: #a2865f; }
.af-hub-row:nth-child(4) .af-row-icon { background: #dde9e8; color: #6a9089; }
.af-row-icon svg { width: 12px; height: 12px; }
.af-hub-row > div { display: grid; gap: 2px; min-width: 0; }
.af-hub-row b { color: #354131; font-size: 8px; font-weight: 500; }
.af-hub-row small { color: #85917c; font-size: 7px; line-height: 1.2; }
.af-row-status { display: inline-flex; align-items: center; gap: 4px; margin-left: auto; color: #71885d; font-size: 7px; white-space: nowrap; }
.af-row-status svg { width: 10px; height: 10px; }
.af-caption { display: flex; align-items: center; justify-content: center; gap: 10px; padding-top: 5px; }
.af-phases { display: flex; align-items: center; justify-content: center; gap: 10px; }
.af-phase { display: inline-flex; align-items: center; gap: 6px; color: #9dae98; font-size: 9px; white-space: nowrap; }
.af-phase + .af-phase::before { content: "→"; color: #73886b; padding-right: 3px; }
.af-film-note { position: absolute; right: 15px; bottom: 7px; color: #74866d; font-size: 6px; letter-spacing: .02em; }

/* Transform/opacity choreography stays on the compositor. No frame-by-frame JS. */
.automation-film .af-input { animation: af-incoming var(--af-cycle) calc(var(--i) * .18s) ease-in-out infinite both; animation-play-state: paused; }
.automation-film .af-agent-core { animation: af-agent-process var(--af-cycle) ease-in-out infinite both; animation-play-state: paused; }
.automation-film .af-agent-orbit { animation: af-agent-ring var(--af-cycle) ease-in-out infinite both; animation-play-state: paused; }
.automation-film .af-hub-row { animation: af-organize var(--af-cycle) calc(var(--i) * .25s) ease-in-out infinite both; animation-play-state: paused; }
.automation-film .af-signal { animation: af-signal-travel var(--af-cycle) ease-in-out infinite both; animation-play-state: paused; }
.automation-film .af-phase { animation: af-phase-highlight var(--af-cycle) calc(var(--phase,0) * 3s) ease-in-out infinite both; animation-play-state: paused; }
.automation-film .af-phase[data-phase="1"] { --phase: 1; }
.automation-film .af-phase[data-phase="2"] { --phase: 2; }
.automation-film.is-playing :is(.af-input,.af-agent-core,.af-agent-orbit,.af-hub-row,.af-signal,.af-phase) { animation-play-state: running; }
.automation-film.is-static :is(.af-input,.af-agent-core,.af-agent-orbit,.af-hub-row,.af-signal,.af-phase) { animation: none !important; }
.automation-film.is-static .af-input { opacity: 1; transform: rotate(var(--af-turn)); }
.automation-film.is-static .af-hub-row { opacity: 1; transform: none; }
@keyframes af-incoming {
  0%,2% { opacity: 0; transform: translate3d(0,-8px,0) rotate(var(--af-turn)) scale(.94); }
  9%,23% { opacity: 1; transform: translate3d(0,0,0) rotate(var(--af-turn)) scale(1); }
  36%,86% { opacity: 0; transform: translate3d(var(--af-fly-x),var(--af-fly-y),0) rotate(0deg) scale(.18); }
  87%,100% { opacity: 0; transform: translate3d(0,-8px,0) rotate(var(--af-turn)) scale(.94); }
}
@keyframes af-agent-process { 0%,23%,62%,100% { transform: scale(1); } 33%,45% { transform: scale(1.08); } 39%,52% { transform: scale(1.02); } }
@keyframes af-agent-ring { 0%,21%,65%,100% { opacity: .4; transform: translateX(-50%) rotate(12deg) scale(1); } 34%,51% { opacity: 1; transform: translateX(-50%) rotate(102deg) scale(1.1); } }
@keyframes af-organize { 0%,31% { opacity: .16; transform: translate3d(0,5px,0); } 46%,86% { opacity: 1; transform: translate3d(0,0,0); } 98%,100% { opacity: .16; transform: translate3d(0,5px,0); } }
@keyframes af-signal-travel { 0%,25% { opacity: 0; transform: translate3d(0,-6px,0); } 32%,42% { opacity: 1; transform: translate3d(0,24px,0); } 54%,100% { opacity: 0; transform: translate3d(0,75px,0); } }
@keyframes af-phase-highlight { 0%,22% { opacity: 1; } 29%,100% { opacity: .45; } }
@media(min-width:801px) {
  .af-path:is(.is-input,.is-output),.af-signal { display: none; }
  .af-path.is-desktop { display: block; }
  .af-inputs { width: 31%; }
  .af-input { --af-turn: 0deg !important; --af-fly-x: 145% !important; --af-fly-y: 0px !important; top: calc(1% + var(--i) * 19%) !important; left: 3% !important; width: 91%; padding: 8px 12px; }
  .af-input-copy b { font-size: 11px; }
  .af-input-copy small { font-size: 9px; }
  .af-agent { top: calc(50% - 33px); left: 46%; width: 150px; }
  .af-hub { top: 50%; bottom: auto; right: 1%; left: auto; width: 38%; transform: translateY(-50%); }
}
@media(max-width:800px) {
  .service-scenes-ready .automation-panel .service-scene .scene-flow { padding: 6px; border-radius: 26px; }
  .service-scenes-ready .automation-panel:not(.service-scene-pinned) .service-scene .scene-flow { height: 490px; min-height: 490px; }
  .automation-panel .automation-film { padding-inline: 13px; grid-template-rows: 46px minmax(0,1fr) 48px; border-radius: 20px; }
  .af-input { gap: 5px; width: 31%; padding: 8px 6px; border-radius: 10px; }
  .af-input-icon { width: 23px; height: 25px; border-radius: 7px; }
  .af-input-copy b { font-size: 9px; }
  .af-input-copy small { font-size: 7px; }
  .af-input-dot { display: none; }
  .af-input:nth-child(4) { left: 3%; }
  .af-input:nth-child(5) { left: 66%; }
  .af-agent { top: 29%; }
  .af-agent-core { width: 52px; height: 52px; border-radius: 17px; }
  .af-agent-core img { width: 32px; height: 32px; }
  .af-agent-orbit { width: 76px; height: 76px; border-radius: 25px; }
  .af-agent-title { margin-top: 7px; font-size: 9px; }
  .af-agent-caption { font-size: 7px; }
  .af-hub { top: 50%; bottom: auto; width: 90%; padding: 11px 10px 7px; transform: translate(-50%,-50%); }
  .af-hub-head { padding-bottom: 7px; }
  .af-hub-stats { padding-bottom: 6px; }
  .af-hub-stats > div { padding-block: 5px; }
  .af-hub-row { min-height: 25px; }
  .af-row-icon { width: 19px; height: 19px; border-radius: 6px; }
  .af-phase { font-size: 8px; }
  .automation-film .af-agent { animation: af-mobile-agent var(--af-cycle) ease-in-out infinite both; animation-play-state: paused; }
  .automation-film .af-hub { animation: af-mobile-hub var(--af-cycle) ease-in-out infinite both; animation-play-state: paused; }
  .automation-film.is-playing :is(.af-agent,.af-hub) { animation-play-state: running; }
  .automation-film.is-static .af-agent,.automation-film.is-static .af-inputs { display: none; }
  .automation-film.is-static .af-hub { animation: none !important; opacity: 1; transform: translate(-50%,-50%); }
}
@keyframes af-mobile-agent { 0%,30%,100% { opacity: 1; transform: translateX(-50%) scale(1); } 44%,88% { opacity: 0; transform: translate(-50%,-30px) scale(.8); } }
@keyframes af-mobile-hub { 0%,32%,100% { opacity: 0; transform: translate(-50%,calc(-50% + 22px)) scale(.96); } 46%,87% { opacity: 1; transform: translate(-50%,-50%) scale(1); } }
@media(max-width:380px) {
  .af-input-icon { width: 18px; }
  .af-input-icon svg { width: 12px; }
  .af-input-copy b { font-size: 8px; }
  .af-input-copy small { font-size: 6px; }
  .af-hub { width: 96%; }
  .af-hub-stats > div { padding-inline: 5px; }
  .af-row-status { font-size: 6px; }
}
@media(prefers-reduced-motion:reduce) {
  .automation-film :is(.af-input,.af-agent-core,.af-agent-orbit,.af-hub-row,.af-signal,.af-phase,.af-agent,.af-hub) { animation: none !important; }
  .automation-film .af-input,.automation-film .af-hub-row { opacity: 1; }
  .automation-film .af-hub-row { transform: none; }
}
