/* Shared interaction feedback; page state never waits for an animation. */
:root {
  --motion-fast: 120ms;
  --motion-view: 180ms;
  --motion-layer: 220ms;
  --motion-ease: cubic-bezier(.22, 1, .36, 1);
}
@keyframes ui-rise-in { from { opacity: 0; transform: translateY(6px); } to { opacity: 1; transform: none; } }
@keyframes ui-fade-in { from { opacity: 0; } to { opacity: 1; } }
@keyframes ui-spin { to { transform: rotate(360deg); } }
.view-section:not(.hidden), .view.is-active, .announcement-page, .workbench > .controls {
  animation: ui-rise-in var(--motion-view) var(--motion-ease) both;
}
.modal-layer:not(.hidden) .modal-backdrop, dialog[open]::backdrop { animation: ui-fade-in var(--motion-fast) ease-out both; }
.modal-layer:not(.hidden) > :not(.modal-backdrop), dialog[open], .sheet {
  animation: ui-rise-in var(--motion-layer) var(--motion-ease) both;
}
:is(.btn, .primary-button, .secondary-button, .text-button, .icon-button, .back-link, .section-tabs button, .bottom-link, .mode-switch button) {
  touch-action: manipulation;
  transition: background-color var(--motion-fast), border-color var(--motion-fast), color var(--motion-fast), box-shadow var(--motion-fast), transform var(--motion-fast);
}
:is(.btn, .primary-button, .secondary-button, .text-button, .back-link, .section-tabs button, .bottom-link, .mode-switch button):active:not(:disabled) { transform: translateY(1px); }
:is(button, a, input, select, textarea, summary):focus-visible { outline: 2px solid var(--coral, #c86046); outline-offset: 3px; }
:is(.creator-dialog, .settings-dialog, .worldbook-dialog, .archive-dialog, .message-editor-dialog, .sheet, dialog) { overscroll-behavior: contain; }
@media (max-width: 700px) {
  :is(.btn, .secondary-button, .text-button, .back-link, .modal-close, .section-tabs button, .mode-switch button, .site-pagination button, .discovery-filters select) { min-height: 44px; }
  :is(.modal-layer, .view, .workbench, .view-section, .auth-view) :is(input:not([type=checkbox]):not([type=radio]), textarea, select) { font-size: 16px; }
  .view { scroll-margin-top: 76px; }
  :is(.creator-dialog, .settings-dialog, .worldbook-dialog, .archive-dialog, .message-editor-dialog, .confirmation-dialog) {
    max-height: calc(100dvh - 24px - env(safe-area-inset-top) - env(safe-area-inset-bottom));
    overflow-y: auto;
    scroll-padding-block: 20px;
  }
  .draw-header { gap: 10px; padding-inline: 12px; }
  .draw-header .brand small { display: none; }
  .header-actions { gap: 8px; }
  .workbench { padding-bottom: calc(28px + env(safe-area-inset-bottom)); }
  .sheet { scroll-padding-bottom: calc(24px + env(safe-area-inset-bottom)); }
}
@media (hover: none) {
  :is(.primary-button, .character-card, .creator-entry-card, .style-option, .ratio-option, .batch-option):hover { transform: none; }
}
@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { animation-duration: .01ms !important; animation-delay: 0ms !important; transition-duration: .01ms !important; scroll-behavior: auto !important; }
}
