/* 보고서 센터 움직임 — report-motion.js 가 body 에 rpm(움직여도 됨) · rpm-in(처음 여는 중) 을 붙이고 뗀다.
   ① 바로 뽑기 칸 차례로 톡 · 목록 줄 차례로  ② 줄을 열면 기간 칩 차례로 톡  ③ 불러오는 동안 프린터에서 종이가 나옴
   ④ 종이가 위에서 아래로 뽑혀 나오고 표 줄이 차례로  ⑤ 앞 · 뒤 기간은 그쪽에서 미끄러져 들어옴  ⑥ 인쇄 단추 한 번 반짝
   움직임 줄이기 · 태극이면 rpm 이 붙지 않는다. */
body { --rpm-ease: cubic-bezier(.22, 1, .36, 1); --rpm-spring: cubic-bezier(.34, 1.56, .64, 1); }

/* ① */
body.rpm.rpm-in #rpQuick button { animation: rpm-pop .5s var(--rpm-spring) both; animation-delay: calc(var(--i, 0) * .06s); }
body.rpm.rpm-in #rpQuick button::before { animation: rpm-pop .5s var(--rpm-spring) both; animation-delay: calc(.15s + var(--i, 0) * .06s); }
body.rpm.rpm-in #rpList > * { animation: rpm-row .45s var(--rpm-ease) both; animation-delay: calc(.45s + var(--i, 0) * .05s); }
/* ② */
body.rpm .rp-open.rpm-open { animation: rpm-reveal .35s var(--rpm-ease) both; }   /* 자리는 그대로, 위에서부터 드러남 */
body.rpm .rp-open.rpm-open .rp-chips button { animation: rpm-pop .4s var(--rpm-spring) both; animation-delay: calc(.08s + var(--i, 0) * .05s); }
body.rpm .rp-open.rpm-open .rp-go { animation: rpm-down .35s var(--rpm-ease) both; animation-delay: .25s; }
body.rpm .rp-row .r { display: inline-block; transition: translate .2s var(--rpm-ease); }
@media (hover: hover) { body.rpm .rp-row:hover .r { translate: 4px 0; } }
/* ③ 프린터 */
.rpm-printer svg { width: 96px; height: 80px; display: block; margin: 0 auto 10px; overflow: visible; }
.rpm-printer .pb { fill: var(--surface-2, var(--surface)); stroke: var(--ink-50, var(--line)); stroke-width: 2; }
.rpm-printer .pp { fill: var(--bg); stroke: var(--ink-50, var(--line)); stroke-width: 2; }
.rpm-printer .ps { fill: var(--ink-50, var(--line)); }
.rpm-printer .pl { fill: var(--accent); animation: rpm-blink 1s ease-in-out infinite; }
.rpm-printer .po rect { fill: var(--bg); stroke: var(--accent); stroke-width: 2; }
.rpm-printer .po path { stroke: var(--accent); stroke-width: 2; stroke-linecap: round; opacity: .6; }
.rpm-printer .po { clip-path: inset(0 0 0 0); animation: rpm-feed 1.4s cubic-bezier(.5, 0, .3, 1) infinite; }
/* ④ ⑤ 종이 */
#previewContent.rpm-out .report-container { animation: rpm-out .7s var(--rpm-ease) both; transform-origin: top center; }
#previewContent.rpm-from-r .report-container { animation: rpm-from-r .45s var(--rpm-ease) both; }
#previewContent.rpm-from-l .report-container { animation: rpm-from-l .45s var(--rpm-ease) both; }
#previewContent:is(.rpm-out, .rpm-from-r, .rpm-from-l) .report-table tbody tr { animation: rpm-fade .35s ease-out both; animation-delay: calc(.35s + var(--n, 0) * 25ms); }
/* ⑥ */
.btn-print.rpm-ready { animation: rpm-glow 1.3s ease-out both; }

@keyframes rpm-pop { 0% { opacity: 0; transform: scale(.6); } 60% { opacity: 1; transform: scale(1.06); } 100% { opacity: 1; transform: none; } }
@keyframes rpm-row { from { opacity: 0; transform: translateX(-14px); } to { opacity: 1; transform: none; } }
@keyframes rpm-reveal { from { clip-path: inset(0 0 100% 0); } to { clip-path: inset(0 0 0 0); } }
@keyframes rpm-down { from { opacity: 0; transform: translateY(-8px); } to { opacity: 1; transform: none; } }
@keyframes rpm-blink { 0%, 100% { opacity: 1; } 50% { opacity: .25; } }
@keyframes rpm-feed { 0% { transform: translateY(-26px); opacity: 0; } 15% { opacity: 1; } 75% { transform: translateY(0); opacity: 1; } 100% { transform: translateY(6px); opacity: 0; } }
@keyframes rpm-out { from { clip-path: inset(0 0 100% 0); transform: translateY(-18px); } to { clip-path: inset(0 0 0 0); transform: none; } }
@keyframes rpm-from-r { from { opacity: 0; transform: translateX(40px); } to { opacity: 1; transform: none; } }
@keyframes rpm-from-l { from { opacity: 0; transform: translateX(-40px); } to { opacity: 1; transform: none; } }
@keyframes rpm-fade { from { opacity: 0; } }
@keyframes rpm-glow { 0% { box-shadow: 0 0 0 0 color-mix(in srgb, var(--accent) 60%, transparent); } 50% { box-shadow: 0 0 0 8px color-mix(in srgb, var(--accent) 20%, transparent); } 100% { box-shadow: 0 0 0 0 transparent; } }

@media (prefers-reduced-motion: reduce) {
  #rpQuick *, #rpQuick button::before, #rpList *, #previewContent *, .btn-print { animation: none !important; transition: none !important; }
}
@media print { .report-container, .report-table tr { animation: none !important; clip-path: none !important; transform: none !important; opacity: 1 !important; } }
