/* Message: the ONE message component. It floats at the bottom of the window (#preview-message-slot, outside
   the swapped area) and stays until dismissed. Tokens only. */
.ph-app .ph-message-slot {
  position: fixed;
  left: 0;
  right: 0;
  bottom: var(--space-4);
  bottom: calc(var(--space-4) + env(safe-area-inset-bottom));
  z-index: var(--z-toast);
  display: flex;
  justify-content: center;
  padding: 0 var(--space-4);
  pointer-events: none; /* only the message itself takes clicks */
}
.ph-app .ph-message {
  pointer-events: auto;
  display: flex;
  align-items: flex-start;
  gap: var(--space-3);
  box-sizing: border-box;
  width: 100%;
  max-width: calc(var(--space-12) * 10);
  max-height: 50vh;
  overflow-y: auto;
  padding: var(--space-3) var(--space-4);
  border: 1px solid var(--border);
  border-radius: var(--radius-md);
  box-shadow: var(--shadow-pop);
  font-size: var(--text-ui);
  line-height: var(--lh-ui);
  animation: ph-message-in var(--motion);
}
/* The design-system page shows messages in the page flow instead of fixed to the window. */
.ph-app .ph-message--inline { max-width: none; animation: none; box-shadow: none; }
.ph-app .ph-message--info { background: var(--info-tint); color: var(--ink); }
.ph-app .ph-message--info .ph-message__icon { color: var(--info); }
.ph-app .ph-message--error { background: var(--danger-tint); color: var(--danger-text); }
.ph-app .ph-message--error .ph-message__icon { color: var(--danger); }
.ph-app .ph-message__icon { flex: none; display: inline-flex; padding-top: var(--space-1); }
.ph-app .ph-message__text { flex: 1 1 auto; min-width: 0; overflow-wrap: anywhere; }
.ph-app .ph-message__close {
  flex: none;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-width: var(--control-h);
  min-height: var(--control-h);
  margin: calc(var(--space-2) * -1) calc(var(--space-2) * -1) calc(var(--space-2) * -1) 0;
  padding: 0;
  border: 0;
  border-radius: var(--radius-sm);
  background: transparent;
  color: inherit;
  cursor: pointer;
}
.ph-app .ph-message__close:hover { background: var(--fill); }
.ph-app .ph-message__close:focus-visible { outline: var(--focus); outline-offset: var(--focus-offset); }
@keyframes ph-message-in { from { opacity: 0; transform: translateY(var(--space-2)); } to { opacity: 1; transform: none; } }
@media (prefers-reduced-motion: reduce) { .ph-app .ph-message { animation: none; } }
