/* 자동 실행 움직임 — cron-motion.js 가 body 에 crm(움직여도 됨) · crm-in 을, 칸마다 crm-on · crm-off · crm-lit · crm-dim · crm-pop · crm-up · crm-fade · crm-run · crm-ok · crm-bad · crm-saved 를 붙이고 뗀다.
   ① 세 칸 톡 · 알람 울림 · 전파 · 다음 차례 톡 · 시간표 물결 · 묶음 카드 · 실패 흔들림  ② 스위치 튕김 · 시간표 줄 켜짐/흐려짐
   ③ 창 올라옴 · 칩 톡 · 바뀐 칸 반짝  ④ 도는 동안 숨쉬기 · 끝나면 빛/흔들림  ⑤ 저장 띠 빛 · 다음 차례 톡.  움직임 줄이기면 crm 이 붙지 않는다. 글자는 바꾸지 않는다. */
body { --crm-ease: cubic-bezier(.22, 1, .36, 1); --crm-spring: cubic-bezier(.34, 1.56, .64, 1); }

/* ① */
body.crm.crm-in #stats .ct { animation: crm-pop-in .5s var(--crm-spring) both; animation-delay: calc(var(--i, 0) * .08s); }
body.crm.crm-in #stOn .l svg { animation: crm-ring .9s ease-in-out both; animation-delay: .4s; transform-origin: 50% 20%; }
body.crm.crm-in #stTick .l svg { animation: crm-wave 1s ease-out 2; animation-delay: .5s; }
body.crm.crm-in #nextCard .nx-big { animation: crm-pop-in .55s var(--crm-spring) both; animation-delay: .3s; }
body.crm.crm-in #nextCard .nx-tl > * { animation: crm-fade .4s ease-out both; animation-delay: .55s; }
body.crm.crm-in #tt i { animation: crm-cell .35s var(--crm-spring) both; animation-delay: calc(.35s + var(--d, 0) * .03s); }
body.crm.crm-in #groups .card { animation: crm-rise .5s var(--crm-ease) both; animation-delay: calc(.3s + var(--i, 0) * .08s); }
body.crm.crm-in #groups .job.st-fail, body.crm.crm-in #problems .alert { animation: crm-shake .5s ease-in-out both; animation-delay: 1s; }
/* ② 스위치는 새로 그려지므로 옛 자리에서 넘어가는 키프레임 */
body.crm .sw.crm-on::after { animation: crm-knob-on .45s var(--crm-spring) both; }
body.crm .sw.crm-off::after { animation: crm-knob-off .4s var(--crm-spring) both; }
body.crm #tt i.crm-lit { animation: crm-lit .45s var(--crm-spring) both; animation-delay: calc(var(--d, 0) * .04s); }
body.crm #tt i.crm-dim { animation: crm-dim .45s ease-out both; animation-delay: calc(var(--d, 0) * .04s); }
/* ③ */
body.crm #sheetBg.crm-fade { animation: crm-fade .3s ease-out both; }
body.crm #sheetBg .sheet.crm-up { animation: crm-rise-big .42s var(--crm-ease) both; }
@media (min-width: 900px) { body.crm #sheetBg .sheet.crm-up { animation: crm-pop-s .4s var(--crm-spring) both; } }
body.crm .hb.crm-pop, body.crm .db.crm-pop { animation: crm-bump .4s var(--crm-spring) both; }
/* ④ */
body.crm #groups .job.crm-run { animation: crm-breathe 1.2s ease-in-out infinite; border-radius: 10px; }
body.crm #groups .job.crm-ok { animation: crm-glow 1.4s ease-out both; border-radius: 10px; }
body.crm #groups .job.crm-bad { animation: crm-shake .5s ease-in-out both; }
/* ⑤ */
body.crm #saveBar.crm-saved { animation: crm-glow 1.2s ease-out both; }
body.crm #nextCard .nx-big.crm-pop { animation: crm-bump .5s var(--crm-spring) both; }

@keyframes crm-pop-in { 0% { opacity: 0; transform: scale(.7); } 60% { opacity: 1; transform: scale(1.05); } 100% { opacity: 1; transform: none; } }
@keyframes crm-pop-s { 0% { opacity: 0; transform: scale(.92); } 100% { opacity: 1; transform: none; } }
@keyframes crm-rise { from { opacity: 0; transform: translateY(14px); } to { opacity: 1; transform: none; } }
@keyframes crm-rise-big { from { opacity: .4; transform: translateY(60px); } to { opacity: 1; transform: none; } }
@keyframes crm-fade { from { opacity: 0; } to { opacity: 1; } }
@keyframes crm-ring { 0%, 100% { transform: rotate(0); } 10%, 30%, 50%, 70% { transform: rotate(-16deg); } 20%, 40%, 60%, 80% { transform: rotate(16deg); } }
@keyframes crm-wave { 0% { filter: drop-shadow(0 0 0 var(--c)); } 50% { filter: drop-shadow(0 0 6px var(--c)); } 100% { filter: none; } }
@keyframes crm-cell { 0% { opacity: 0; transform: scaleY(.2); } 100% { opacity: 1; transform: none; } }
@keyframes crm-shake { 0%, 100% { translate: 0 0; } 20%, 60% { translate: -5px 0; } 40%, 80% { translate: 5px 0; } }
@keyframes crm-knob-on { 0% { left: 3px; } 70% { left: 24px; } 100% { left: 21px; } }
@keyframes crm-knob-off { 0% { left: 21px; } 70% { left: 1px; } 100% { left: 3px; } }
@keyframes crm-lit { 0% { transform: scaleY(.3); filter: brightness(1.8); } 100% { transform: none; filter: none; } }
@keyframes crm-dim { 0% { background: var(--accent); } 100% { } }
@keyframes crm-bump { 0% { transform: scale(1); } 40% { transform: scale(1.15); } 100% { transform: none; } }
@keyframes crm-breathe { 0%, 100% { box-shadow: 0 0 0 0 transparent; } 50% { box-shadow: 0 0 0 3px color-mix(in srgb, var(--accent) 45%, transparent); } }
@keyframes crm-glow { 0% { box-shadow: 0 0 0 3px var(--good, var(--accent)); } 100% { box-shadow: 0 0 0 0 transparent; } }

@media (prefers-reduced-motion: reduce) {
  #stats .ct, #stats svg, #nextCard *, #tt i, #groups .card, #groups .job, #groups .sw::after, #problems .alert, #sheetBg, #sheetBg .sheet, .hb, .db, #saveBar { animation: none !important; }
}
@media print { #stats .ct, #tt i, #groups .card { animation: none !important; } }
