/* Quiet motion for the active OpenMuse surface. Keep long-running task states readable. */
.openmuse-ui {
  --motion-quick: 150ms;
  --motion-normal: 220ms;
  --motion-ease: cubic-bezier(.2, .8, .2, 1);
}

.openmuse-ui .sidebar {
  transition: transform var(--motion-normal) var(--motion-ease);
}
.openmuse-ui .sidebar-backdrop:not([hidden]) {
  animation: dd-backdrop-in 220ms ease-out both;
}
.openmuse-ui .sidebar-backdrop.is-closing {
  pointer-events: none;
  animation: dd-backdrop-out 180ms ease-in both;
}
.openmuse-ui .account-menu:not([hidden]) {
  transform-origin: left bottom;
  animation: dd-menu-in 180ms var(--motion-ease) both;
}
.openmuse-ui .timeline.is-switching {
  animation: dd-content-in 180ms var(--motion-ease) both;
}
.openmuse-ui .timeline > .motion-enter {
  animation: dd-content-in 240ms var(--motion-ease) both;
}
.openmuse-ui .toast {
  animation: dd-toast-in 220ms var(--motion-ease) both;
}
.openmuse-ui .toast.is-leaving {
  animation: dd-toast-out 200ms ease-in both;
}
.openmuse-ui .answer-feedback-overlay {
  animation: dd-backdrop-in 180ms ease-out both;
}
.openmuse-ui .answer-feedback-panel,
.openmuse-ui dialog[open] {
  animation: dd-dialog-in 220ms var(--motion-ease) both;
}
.openmuse-ui .answer-feedback-overlay.is-leaving {
  pointer-events: none;
  animation: dd-backdrop-out 160ms ease-in both;
}
.openmuse-ui .answer-feedback-overlay.is-leaving .answer-feedback-panel {
  animation: dd-dialog-out 160ms ease-in both;
}
.openmuse-ui dialog[open]::backdrop {
  animation: dd-backdrop-in 220ms ease-out both;
}

.openmuse-ui .conversation-row,
.openmuse-ui .account-trigger,
.openmuse-ui .account-menu-item,
.openmuse-ui .mobile-menu,
.openmuse-ui .muse-top-action,
.openmuse-ui .muse-dock-button,
.openmuse-ui .desktop-muse-rail-button,
.openmuse-ui .attachment,
.openmuse-ui .send-button,
.openmuse-ui .primary,
.openmuse-ui .secondary,
.openmuse-ui .danger,
.openmuse-ui .answer-rating-choice {
  transition: background-color var(--motion-quick) ease, color var(--motion-quick) ease,
    border-color var(--motion-quick) ease, box-shadow var(--motion-quick) ease,
    transform var(--motion-quick) var(--motion-ease);
}
.openmuse-ui .composer {
  transition: border-color var(--motion-normal) ease, box-shadow var(--motion-normal) ease;
}
.openmuse-ui .plugin-switch input,
.openmuse-ui .plugin-switch input::after {
  transition-duration: var(--motion-normal);
}

@media (hover: hover) and (pointer: fine) {
  .openmuse-ui .mobile-menu:hover,
  .openmuse-ui .muse-top-action:hover,
  .openmuse-ui .muse-dock-button:hover,
  .openmuse-ui .desktop-muse-rail-button:hover,
  .openmuse-ui .attachment:hover,
  .openmuse-ui .send-button:not(:disabled):hover,
  .openmuse-ui .primary:not(:disabled):hover,
  .openmuse-ui .secondary:not(:disabled):hover {
    transform: translateY(-.0625rem);
  }
}
.openmuse-ui .mobile-menu:not(:disabled):active,
.openmuse-ui .muse-top-action:not(:disabled):active,
.openmuse-ui .muse-dock-button:not(:disabled):active,
.openmuse-ui .desktop-muse-rail-button:not(:disabled):active,
.openmuse-ui .attachment:not(:disabled):active,
.openmuse-ui .send-button:not(:disabled):active,
.openmuse-ui .primary:not(:disabled):active,
.openmuse-ui .secondary:not(:disabled):active { scale: .98; }

@keyframes dd-backdrop-in { from { opacity: 0; } to { opacity: 1; } }
@keyframes dd-backdrop-out { from { opacity: 1; } to { opacity: 0; } }
@keyframes dd-menu-in {
  from { opacity: 0; transform: translateY(.375rem) scale(.985); }
  to { opacity: 1; transform: translateY(0) scale(1); }
}
@keyframes dd-content-in {
  from { opacity: 0; transform: translateY(.35rem); }
  to { opacity: 1; transform: translateY(0); }
}
@keyframes dd-toast-in {
  from { opacity: 0; translate: 0 .375rem; }
  to { opacity: 1; translate: 0 0; }
}
@keyframes dd-toast-out {
  from { opacity: 1; translate: 0 0; }
  to { opacity: 0; translate: 0 .25rem; }
}
@keyframes dd-dialog-in {
  from { opacity: 0; transform: translateY(.5rem) scale(.99); }
  to { opacity: 1; transform: translateY(0) scale(1); }
}
@keyframes dd-dialog-out {
  from { opacity: 1; transform: translateY(0) scale(1); }
  to { opacity: 0; transform: translateY(.25rem) scale(.99); }
}

@media (prefers-reduced-motion: reduce) {
  .openmuse-ui *, .openmuse-ui *::before, .openmuse-ui *::after {
    animation: none !important;
    transition-duration: .01ms !important;
    scroll-behavior: auto !important;
  }
  .openmuse-ui dialog::backdrop { animation: none !important; }
  .openmuse-ui button:active { scale: 1; }
}
