/* The fifth example shares the existing Before / After controls. */
.agent-world { display: none; position: absolute; inset: 0; perspective: 900px; color: #123e2f; }
.scene[data-topic="4"] .agent-world { display: block; }
.scene[data-topic="4"] > svg,
.scene[data-topic="4"] > .tile,
.scene[data-topic="4"] > .hub,
.scene[data-topic="4"] > .result,
.scene[data-topic="4"] > .manual-label,
.scene[data-topic="4"] > .scene-step { display: none; }
.agent-floor { position: absolute; inset: 55px 5% 65px; background: #d5ebdf; border: 1px solid #b6d6c3; border-radius: 30px; transform: rotateX(55deg) rotateZ(-9deg); box-shadow: 0 12px 0 #c5dece; }
.agent-panel { position: absolute; padding: 12px; border: 1px solid #b8d5c4; border-radius: 12px; background: #fff; box-shadow: 4px 6px 0 #c6ddce, 0 16px 24px #123e2f15; font-size: 11px; transition: transform .6s, background .6s; }
.agent-panel small { display: block; font-size: 10px; font-weight: 700; color: #276548; border-bottom: 1px solid #d8e8de; padding-bottom: 7px; margin-bottom: 8px; }
.agent-panel b { display: block; font-size: 11px; }
.agent-panel > span { display: block; font-size: 9px; color: #456957; margin: 2px 0 8px; }
.agent-input { left: 4%; top: 48px; width: 27%; transform: rotateY(12deg) rotateZ(-4deg); }
.agent-core { position: absolute; left: 35%; top: 117px; width: 23%; min-height: 95px; padding: 12px 6px; text-align: center; border: 1px solid #b7cdba; border-radius: 17px; background: #fff4df; box-shadow: 0 7px 0 #dbcba9, 0 16px 20px #123e2f15; transform: rotateY(-10deg); transition: background .6s, transform .6s; }
.agent-core > span { display: block; font-size: 23px; line-height: 1.2; color: #88662d; }
.agent-core b { font-size: 11px; line-height: 1.6; white-space: nowrap; }
.agent-research { right: 4%; top: 35px; width: 32%; transform: rotateY(-12deg) rotateZ(4deg); }
.agent-retry { margin-top: 8px; padding: 6px 3px; border-radius: 6px; background: #fff2d9; color: #795013; font-size: 9px; font-weight: 700; }
.agent-retry i { display: inline-block; font-style: normal; font-size: 15px; vertical-align: middle; }
.agent-output { right: 4%; top: 209px; width: 46%; transform: rotateY(-12deg) rotateZ(3deg); }
.agent-output > div { display: flex; align-items: center; justify-content: space-between; gap: 5px; margin: 5px 0; }
.agent-output em { font-size: 9px; font-style: normal; color: #266345; background: #e0f3e6; border-radius: 4px; padding: 1px 6px; }
.agent-output .agent-review { color: #795013; background: #fff0d2; }
.agent-path { position: absolute; color: #6b8273; font-size: 24px; }
.agent-path-one { left: 30%; top: 130px; }
.agent-path-two { left: 59%; top: 117px; }
.agent-path-three { right: 18%; top: 175px; }
.agent-caption { position: absolute; left: 3%; right: 3%; bottom: 5px; text-align: center; font-size: 11px; font-weight: 700; line-height: 1.7; margin: 0; }
.scene:not(.after) .agent-output em { color: #6b593e; background: #f6eddf; }
.scene:not(.after) .agent-output em::before { content: '… '; }
.scene:not(.after) .agent-output { opacity: .8; }
.scene:not(.after) .agent-retry { background: #f4eee3; }
.scene.after .agent-core { background: #123e2f; color: #fff; box-shadow: 0 7px 0 #82a98d, 0 16px 20px #123e2f20; transform: rotateY(0); }
.scene.after .agent-core > span { color: #d3f38c; }
.scene.after .agent-panel { transform: rotateY(0) rotateZ(0); }
.scene.after .agent-path { color: #247a4e; animation: agent-flow 3s ease-in-out infinite; }
.scene.after .agent-retry { animation: agent-research 4s ease-in-out infinite; }
.scene.after .agent-retry i { animation: agent-turn 4s ease-in-out infinite; }
@keyframes agent-flow { 0%,100% { opacity: .4; } 50% { opacity: 1; } }
@keyframes agent-research { 0%,100% { box-shadow: none; } 50% { box-shadow: 0 0 0 3px #e0b34d40; } }
@keyframes agent-turn { 0%,25% { transform: rotate(0); } 75%,100% { transform: rotate(360deg); } }
.ext-connection { display: none; position: absolute; left: 8%; right: 8%; top: 5px; justify-content: center; align-items: center; gap: 8px; font-size: 9px; color: #175638; }
.scene.after .ext-connection { display: flex; }
.ext-connection span { background: #e8f7ee; border: 1px solid #b5d9c4; border-radius: 6px; padding: 4px 7px; box-shadow: 0 3px 0 #c9e2d3; }
.ext-connection i { font-style: normal; }
@media (max-width: 760px) {
    .agent-panel { padding: 8px; }
    .agent-panel small { font-size: 9px; }
    .agent-panel b { font-size: 10px; }
    .agent-panel > span { font-size: 8px; }
    .agent-input { left: 2%; width: 28%; }
    .agent-research { right: 2%; width: 34%; }
    .agent-core { left: 32%; width: 30%; }
    .agent-core b { font-size: 10px; }
    .agent-output { right: 2%; top: 235px; width: 48%; }
    .agent-retry { font-size: 8px; }
    .agent-caption { font-size: 10px; }
    .ext-connection { left: 3%; right: 3%; gap: 4px; }
    .ext-connection span { padding: 4px; }
}
@media (prefers-reduced-motion: reduce) {
    .agent-world *, .agent-world *::before { animation: none !important; transition: none !important; }
}
.no-motion .agent-world * { animation: none !important; transition: none !important; }
