/* 출하 단가 계산기 움직임 — calculator-motion.js 가 body 에 spc(움직여도 됨)를, 칸마다 spc-in · spc-pop · spc-ring · spc-next · spc-prev · spc-rows · spc-rise · spc-up 을 붙이고 뗀다.
   ① 결과 머리 · 금액 칸 차례로 · 유리한 칸 고리  ② 바뀐 금액 톡 · 유리한 칸 고리  ③ 탭 쪽에서 밀려 들어옴  ④ 출하 줄 차례로  ⑤ 결과 칸 톡 · 합계 칸 올라옴  ⑥ 창 올라옴.
   움직임 줄이기면 spc 가 붙지 않는다. 글자는 바꾸지 않는다. 계속 도는 움직임은 없다. */
body { --spc-ease: cubic-bezier(.22, 1, .36, 1); --spc-spring: cubic-bezier(.34, 1.56, .64, 1); }

/* ① 다시 그려져도 --spc-t 만큼 앞당겨 이어 간다 */
body.spc #result.spc-in .hero { animation: spc-rise .5s var(--spc-ease) var(--spc-t, 0ms) both; }
body.spc #result.spc-in .hero h2 strong { display: inline-block; animation: spc-pop .5s var(--spc-spring) calc(var(--spc-t, 0ms) + .3s) both; }
body.spc #result.spc-in .totals .total { animation: spc-rise .45s var(--spc-ease) calc(var(--spc-t, 0ms) + .35s + var(--i, 0) * .12s) both; }
body.spc #result.spc-in .totals .total.win { animation: spc-rise .45s var(--spc-ease) calc(var(--spc-t, 0ms) + .35s + var(--i, 0) * .12s) both, spc-ring 1s ease-out calc(var(--spc-t, 0ms) + .9s) both; }
/* ② */
body.spc #result .spc-pop { display: inline-block; animation: spc-pop .45s var(--spc-spring) both; }
body.spc #result .total.spc-ring { animation: spc-ring 1s ease-out both; }
/* ③ 가로를 잠깐 잘라 옆으로 밀리지 않게 */
body.spc :is(#calcTab, #archive):is(.spc-next, .spc-prev) { overflow-x: clip; }
body.spc :is(#calcTab, #archive).spc-next > * { animation: spc-in-r .45s var(--spc-ease) both; }
body.spc :is(#calcTab, #archive).spc-prev > * { animation: spc-in-l .45s var(--spc-ease) both; }
/* ④ */
body.spc #farmLotsBody.spc-rows tr { animation: spc-rise .4s var(--spc-ease) both; animation-delay: calc(.05s + var(--i, 0) * .05s); }
/* ⑤ */
body.spc #farmLotsBody .lot-result.spc-pop { animation: spc-flash .5s ease-out both; }
body.spc #batchSummary.spc-rise { animation: spc-rise .45s var(--spc-ease) both; }
/* ⑥ */
body.spc dialog.spc-up[open] { animation: spc-up .45s var(--spc-ease) both; }

@keyframes spc-rise { from { opacity: 0; translate: 0 12px; } to { opacity: 1; translate: 0 0; } }
@keyframes spc-up { from { opacity: 0; translate: 0 40px; } to { opacity: 1; translate: 0 0; } }
@keyframes spc-in-r { from { opacity: 0; translate: 26px 0; } to { opacity: 1; translate: 0 0; } }
@keyframes spc-in-l { from { opacity: 0; translate: -26px 0; } to { opacity: 1; translate: 0 0; } }
@keyframes spc-pop { 0% { scale: 1; } 45% { scale: 1.12; } 100% { scale: 1; } }
@keyframes spc-flash { 0% { background-color: color-mix(in srgb, var(--green) 26%, transparent); } 100% { } }
@keyframes spc-ring { 0% { outline: 2px solid var(--green); outline-offset: 0; } 100% { outline: 2px solid transparent; outline-offset: 10px; } }

@media (prefers-reduced-motion: reduce) {
  #result *, #calcTab > *, #archive > *, #farmLotsBody tr, #farmLotsBody td, #batchSummary, dialog { animation: none !important; }
}
@media print { #result *, #farmLotsBody tr, #batchSummary { animation: none !important; } }
