/* 관리 → 화면 움직임 — appearance-motion.js 가 body 에 apm(움직여도 됨) · apm-in 을, html 에 apm-fade 를, 칸마다 apm-pick · apm-pop · apm-flip · apm-rise · apm-tap · apm-saved · apm-ring 을 붙이고 뗀다.
   ① 지금 설정 칸 차례로 · 아이콘 톡  ② 테마 카드 차례로 또렷 · 작은 화면 그려짐 (카드 자리는 그대로)  ③ 색이 부드럽게 넘어감 · 고른 카드 고리 · ✓ 톡 · 테마 칸 뒤집힘
   ④ '가' 톡 · 글자 칸 뒤집힘  ⑤ 프리셋 칸 톡 · 저장 띠 올라옴 · 저장 고리 · 움직임 칸 뒤집힘  ⑥ 구역 제목 빛.
   움직임 줄이기면 apm 이 붙지 않는다. 글자는 바꾸지 않는다. 계속 도는 움직임은 없다. */
body { --apm-ease: cubic-bezier(.22, 1, .36, 1); --apm-spring: cubic-bezier(.34, 1.56, .64, 1); }

/* ① */
body.apm.apm-in #apNow [data-k] { animation: apm-rise .5s var(--apm-ease) both; animation-delay: calc(var(--i, 0) * .09s); }
body.apm.apm-in #apNow [data-k] .ap-ic { animation: apm-pop .5s var(--apm-spring) both; animation-delay: calc(.2s + var(--i, 0) * .09s); }
/* ② 테마 카드는 검사가 자리를 잰다 — 또렷해지기만, 속 작은 화면만 움직인다 */
body.apm.apm-in [data-mode-choice] { animation: apm-fadein .5s ease-out both; animation-delay: calc(.3s + var(--i, 0) * .1s); }
body.apm.apm-in [data-mode-choice] .ap-pv .nav { transform-origin: left center; animation: apm-grow-x .45s var(--apm-ease) both; animation-delay: calc(.5s + var(--i, 0) * .1s); }
body.apm.apm-in [data-mode-choice] .ap-pv .hd { animation: apm-fadein .4s ease-out both; animation-delay: calc(.7s + var(--i, 0) * .1s); }
body.apm.apm-in [data-mode-choice] .ap-pv .cells > * { animation: apm-pop .4s var(--apm-spring) both; animation-delay: calc(.85s + var(--i, 0) * .1s); }
/* ③ 색이 부드럽게 넘어감 (0.5초만) */
html.apm-fade body, html.apm-fade body :is(.wrap, .wrap *, .hanul-sidebar, .hanul-sidebar *) { transition: background-color .45s ease, color .45s ease, border-color .45s ease !important; }
body.apm [data-mode-choice].apm-pick { animation: apm-ring 1s ease-out both; }
body.apm .apm-pop { display: inline-flex; animation: apm-pop .45s var(--apm-spring) both; }
body.apm #apNow [data-k].apm-flip b { display: inline-block; animation: apm-flip .6s var(--apm-ease) var(--apm-t, 0ms) both; }
/* ⑤ */
body.apm #fxGrid .fx-option.apm-tap { animation: apm-tap .4s var(--apm-spring) both; }
body.apm #fxBar.apm-rise { animation: apm-rise .45s var(--apm-spring) both; }
body.apm #fxGrid .fx-option.apm-saved { --c: var(--good, var(--accent)); animation: apm-ring 1.2s ease-out both; }
/* ⑥ */
body.apm .ap-h.apm-ring, body.apm .ap-fh.apm-ring, body.apm .apm-ring { animation: apm-ring 1.1s ease-out both; border-radius: 10px; }

@keyframes apm-rise { from { opacity: 0; translate: 0 12px; } to { opacity: 1; translate: 0 0; } }
@keyframes apm-fadein { from { opacity: 0; } to { opacity: 1; } }
@keyframes apm-grow-x { from { scale: 0 1; } to { scale: 1 1; } }
@keyframes apm-pop { 0% { opacity: 0; scale: .6; } 60% { opacity: 1; scale: 1.12; } 100% { opacity: 1; scale: 1; } }
@keyframes apm-tap { 0% { scale: 1; } 40% { scale: 1.04; } 100% { scale: 1; } }
@keyframes apm-flip { 0% { transform: rotateX(0); } 50% { transform: rotateX(90deg); } 100% { transform: rotateX(0); } }
@keyframes apm-ring { 0% { outline: 2px solid var(--c, var(--accent)); outline-offset: 0; } 100% { outline: 2px solid transparent; outline-offset: 10px; } }

@media (prefers-reduced-motion: reduce) {
  #apNow [data-k], #apNow .ap-ic, #apNow b, [data-mode-choice], .ap-pv *, .ap-cur, .ap-frow b, #fxGrid .fx-option, #fxBar, .ap-h, .ap-fh { animation: none !important; }
  html.apm-fade body, html.apm-fade body * { transition: none !important; }
}
@media print { #apNow [data-k], [data-mode-choice], .ap-pv *, #fxGrid .fx-option { animation: none !important; } }
