/* 움직임. 상태가 바뀐 것을 알릴 때만, 짧게(0.12~0.18초), 한 번만 쓴다. 꾸미기용 움직임은 넣지 않는다.
   - 메뉴: 올렸을 때·선택됐을 때 색이 부드럽게 바뀌고 아이콘이 채워진다.
   - 누름: 버튼·칩·메뉴를 누르는 순간 살짝 눌린다.
   - 펼침: 접었다 편 줄, 새로 뜬 창이 짧게 떠오른다.
   - 일하는 중: 새로 고침 아이콘은 다시 불러오는 동안만 돈다.
   - 새 알림: 메뉴의 빨간 점은 처음 생길 때 한 번만 튄다(base.html이 mo-pop을 붙인다).
   표의 줄·숫자·카드에는 넣지 않는다. 화면 전체가 움직이는 전환도 넣지 않는다.
   모든 화면이 같은 시간·방식을 쓰도록 이 파일 한 곳에 둔다. '동작 줄이기'를 켠 사람에게는 끈다. */
:root {
  --mo-fast: 120ms;
  --mo-base: 180ms;
  --mo-ease: cubic-bezier(0.2, 0, 0, 1);
}

/* 1. 메뉴 */
nav a {
  transition: background-color var(--mo-base) var(--mo-ease), color var(--mo-base) var(--mo-ease),
    transform var(--mo-fast) var(--mo-ease);
}
nav a .material-symbols-outlined { transition: font-variation-settings var(--mo-base) var(--mo-ease); }
nav.top-menu a:not([aria-disabled="true"]):hover .material-symbols-outlined:not(.open-out) {
  font-variation-settings: "FILL" 1, "wght" 500, "GRAD" 0, "opsz" 24;
}
/* 화면을 옮기면 새로 선택된 상단 메뉴의 바탕이 한 번 스며든다(하위 메뉴는 필터를 바꿀 때마다 다시 그려지므로 넣지 않는다). */
nav.top-menu a[aria-current="page"] { animation: mo-pill-in var(--mo-base) var(--mo-ease); }
@keyframes mo-pill-in { from { background-color: transparent; } }

/* 2. 누름 반응 */
button:where(:not([class])), button.ghost, button.compact, button.danger, button.icon-button, a.button, .icon-button {
  transition: box-shadow var(--mo-base) var(--mo-ease), background-color var(--mo-base) var(--mo-ease),
    filter var(--mo-base) var(--mo-ease), transform var(--mo-fast) var(--mo-ease);
}
.ss-chip, .sl-seg-item, a.page-link, .tool-slot, .vt-refresh {
  transition: background-color var(--mo-base) var(--mo-ease), color var(--mo-base) var(--mo-ease),
    border-color var(--mo-base) var(--mo-ease), transform var(--mo-fast) var(--mo-ease);
}
button:where(:not([class])):not(:disabled):active, button.ghost:not(:disabled):active, button.compact:not(:disabled):active,
button.danger:not(:disabled):active, button.icon-button:not(:disabled):active, a.button:active, .icon-button:active,
nav a:not([aria-disabled="true"]):active, .ss-chip:active, .sl-seg-item:active, a.page-link:active, .tool-slot:active,
.vt-refresh:active {
  transform: scale(0.96);
}

/* 3. 펼침·접힘: 방금 편 팀의 줄만 짧게 떠오른다(처음 화면을 열 때는 움직이지 않는다). */
.vt-body.vt-opened tr:not(.vt-group) { animation: mo-rise var(--mo-base) var(--mo-ease); }
@keyframes mo-rise { from { opacity: 0; transform: translateY(-4px); } }

/* 4. 창(모달): 아래에서 살짝 올라오며 뜨고, 뒤 배경은 스며든다. 닫을 때는 바로 닫힌다. */
dialog:not(.m-drawer):not(.lightbox)[open] { animation: mo-dialog-in var(--mo-base) var(--mo-ease); }
dialog:not(.m-drawer)[open]::backdrop, dialog.lightbox[open] { animation: mo-fade-in var(--mo-base) linear; }
@keyframes mo-dialog-in { from { opacity: 0; transform: translateY(8px) scale(0.98); } }
@keyframes mo-fade-in { from { opacity: 0; } }

/* 5. 일하는 중: 누른 뒤 화면을 다시 불러오는 동안만 돈다. */
.vt-refresh.spinning .material-symbols-outlined { animation: mo-spin 0.8s linear infinite; }
@keyframes mo-spin { to { transform: rotate(360deg); } }

/* 6. 새 알림 점: 처음 생길 때 한 번. */
.menu-dot.mo-pop { animation: mo-pop 320ms var(--mo-ease); }
@keyframes mo-pop { 0% { transform: scale(0); } 60% { transform: scale(1.6); } 100% { transform: scale(1); } }

@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after {
    animation-duration: 0.01ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: 0.01ms !important;
    scroll-behavior: auto !important;
  }
}
