/* The animal leaves its badge, grips the top-left corner, carries the card,
   then loops outside the landed card and returns to its bottom-right home.
   All motion, warm borders, avatars, checkmarks, and confetti use real DOM. */
@property --task-border-angle {
  syntax: '<angle>';
  initial-value: 0deg;
  inherits: false;
}
@keyframes task-border-orbit { to { --task-border-angle: 360deg; } }
@keyframes agent-zoom-in {
  0% { opacity: 0; transform: scale(.12); }
  65% { opacity: 1; transform: scale(1.24); }
  84% { transform: scale(.94); }
  100% { opacity: 1; transform: scale(1); }
}
@keyframes completion-zoom {
  0% { opacity: 0; transform: scale(.1); }
  60% { opacity: 1; transform: scale(1.3); }
  80% { transform: scale(.93); }
  100% { opacity: 1; transform: scale(1); }
}
@keyframes completion-ripple {
  0% { opacity: .65; transform: scale(.8); }
  100% { opacity: 0; transform: scale(3.4); }
}
@keyframes confetti-pop {
  0% { opacity: 0; transform: translate(-50%,-50%) scale(.4); }
  12% { opacity: 1; }
  68% { opacity: 1; }
  100% { opacity: 0; transform: translate(calc(-50% + var(--burst-x)),calc(-50% + var(--burst-y))) rotate(var(--burst-turn)) scale(.45); }
}

.workspace-window { position: relative; }
.board-columns { align-items: stretch; }
.kanban-column { display: flex; flex-direction: column; height: 302px; }
.column-heading { flex-shrink: 0; }
.task-list { flex: 1; min-height: 0; align-content: start; padding: 3px; overflow-y: auto; overflow-x: hidden; overscroll-behavior: contain; scrollbar-width: thin; scrollbar-color: #d6e3f8 transparent; }
.task-item { min-width: 0; position: relative; }
/* Stable widths avoid wrapping changes as the demo fills a list. Disable scroll
   anchoring so inserting a slot cannot silently counteract its downward motion. */
.task-list { position: relative; scrollbar-gutter: stable; overflow-anchor: none; }
.task-item.is-reflowing { z-index: 2; will-change: transform; }
.task-item.is-vacated { display: none; }
.task-size-probe { position: absolute; top: 0; left: 0; visibility: hidden; pointer-events: none; }
.task-card { position: relative; isolation: isolate; border-width: 1.5px; border-radius: 8px; }
.task-meta { min-height: 22px; }
.task-card[data-task-status="progress"] {
  border-color: transparent;
  background: linear-gradient(#fff,#fff) padding-box,
    conic-gradient(from var(--task-border-angle), #ffecad 0%, #ffecad 36%, #ffd43b 51%, #dba515 65%, #fa8b22 78%, #ffe169 92%, #ffecad 100%) border-box;
  animation: task-border-orbit 2.6s linear infinite;
  box-shadow: 0 2px 9px #c78a2012;
}
.task-card[data-task-status="progress"]:hover { border-color: transparent; box-shadow: 0 4px 13px #cd971a24; }
.task-card:active { transform: rotate(5deg) scale(1.05); z-index: 3; }
.agent-just-assigned { animation: agent-zoom-in 480ms cubic-bezier(.16,.8,.24,1) both; }
.task-complete { position: relative; isolation: isolate; background: transparent; overflow: visible; }
.task-check-disc { position: relative; z-index: 2; width: 100%; height: 100%; display: grid; place-items: center; border-radius: 50%; background: #08ba72; box-shadow: 0 1px 3px #0cb57422; }
.task-complete.is-celebrating .task-check-disc { animation: completion-zoom 520ms cubic-bezier(.16,.8,.24,1) both; }
.task-complete.is-celebrating::after { content: ''; position: absolute; inset: 0; border: 1px solid #27c790; border-radius: 50%; z-index: 0; animation: completion-ripple 600ms ease-out both; }
.completion-confetti { position: absolute; inset: 0; pointer-events: none; z-index: 1; overflow: visible; }
.confetti-piece { position: absolute; top: 50%; left: 50%; width: 3px; height: 5px; border-radius: 1px; opacity: 0; animation: confetti-pop 710ms cubic-bezier(.12,.65,.23,1) var(--burst-delay,0ms) both; }
.confetti-piece:nth-child(3n) { width: 3px; height: 3px; border-radius: 50%; }
.confetti-color-0 { background: #39cfa1; }
.confetti-color-1 { background: #6587ff; }
.confetti-color-2 { background: #c586f8; }
.confetti-color-3 { background: #ffc156; }

/* The fixed-height lists keep the brochure steady as the demo fills Done. */
.board-columns.is-auto-moving { scroll-snap-type: none; scroll-behavior: auto; }
.is-flight-source > .task-card { visibility: hidden; }
.is-flight-source::after, .destination-slot::after { content: ''; position: absolute; inset: 0; border: 1px dashed #a9c3ef; border-radius: 8px; background: #eaf1fc85; pointer-events: none; }
.destination-slot { flex-shrink: 0; z-index: 0; }
.destination-slot::after { border-color: #9baefa; background: #eaf0ff; }
.receiving-task { border-color: #c5d8ff; }
.column-progress.receiving-task { border-color: #efd396; }
.column-progress .destination-slot::after { border-color: #e9bd55; background: #fff6df; }
.column-done.receiving-task { border-color: #a9e4c9; }
.column-done .destination-slot::after { border-color: #98d7b7; background: #e8f6ef; }
.task-flight-layer { position: absolute; inset: 0; z-index: 20; pointer-events: none; overflow: clip; }
.task-flight { position: absolute; top: 0; left: 0; transform-origin: center; will-change: transform; pointer-events: none; }
.task-flight .task-flight-card { width: 100%; height: 100%; min-height: 0; margin: 0; transform: none !important; transition: none; box-shadow: 0 calc(var(--lift-shadow,1) * 11px) calc(var(--lift-shadow,1) * 23px) #41599335, 0 2px 5px #41599319; }
/* This single avatar is the mover; the resting copy stays hidden until return. */
.avatar-in-transit { visibility: hidden !important; animation: none !important; }
.task-flight-avatar {
  position: absolute; left: 0; top: 0; z-index: 3; margin: 0;
  pointer-events: none; user-select: none; transform-origin: center;
  will-change: transform; animation: none !important;
  box-shadow: 0 2px 5px #46351026;
}
.task-flight-avatar.is-carrying {
  border-color: #fff8df;
  box-shadow: 0 0 0 2px #efbb4899, 0 4px 10px #9c681d30;
}
.task-flight-avatar.is-returning {
  border-color: #fff; box-shadow: 0 2px 7px #46351026;
}


.board-playback { display: flex; align-items: center; justify-content: flex-start; flex-wrap: wrap; gap: 5px 9px; margin-top: 10px; padding: 0 2px; }
.playback-status { display: inline-flex; align-items: center; gap: 6px; color: #6a7ea1; font-size: 8px; line-height: 1.35; }
.playback-dot { width: 5px; height: 5px; border-radius: 50%; background: #6678fc; box-shadow: 0 0 0 3px #edf0ff; flex-shrink: 0; }
.board-motion-paused .playback-dot { background: #9caac2; box-shadow: 0 0 0 3px #f0f3f8; }
.board-motion-paused .task-card[data-task-status="progress"] { animation-play-state: paused; }

@container workspace (max-width: 810px) {
  .kanban-column { height: 312px; }
  .playback-status { font-size: 7.5px; }
  .task-meta { min-height: 20px; }
}
@container workspace (max-width: 680px) {
  .kanban-column { height: 312px; }
  .task-meta { min-height: 22px; }
  .playback-status { font-size: 9px; }
}
@container workspace (max-width: 510px) {
  .kanban-column { height: 346px; }
  .task-meta { min-height: 26px; }
  .task-list { padding: 3px; }
  .playback-status { font-size: 9px; }
}
@media (prefers-reduced-motion: reduce) {
  .task-card, .task-card[data-task-status="progress"], .agent-just-assigned,
  .task-check-disc, .task-complete::after, .confetti-piece { animation: none !important; transition: none !important; }
  .task-card:active { transform: none; }
  .completion-confetti, .task-flight-avatar { display: none; }
}
@media print {
  .board-playback, .task-flight-layer { display: none; }
  .task-card[data-task-status="progress"] { animation: none !important; }
  .kanban-column { height: auto; }
  .task-list { overflow: visible; }
}

@media print {
  .destination-slot, .task-size-probe { display: none !important; }
  .task-item.is-vacated { display: list-item; }
  .is-flight-source > .task-card { visibility: visible; }
  .is-flight-source::after { display: none; }
  .avatar-in-transit { visibility: visible !important; }
}
