/* In-app notices. Include with app_notice.js. Sits above the page; the page stays usable. */

.app-notice-stack {
  position: fixed;
  top: 16px;
  right: 16px;
  z-index: 1000000;
  display: flex;
  flex-direction: column;
  gap: 8px;
  width: min(420px, calc(100vw - 32px));
  max-height: calc(100vh - 32px);
  overflow-y: auto;
  pointer-events: none;
}

.app-notice {
  pointer-events: auto;
  flex: 0 0 auto;
  display: flex;
  align-items: flex-start;
  gap: 12px;
  margin: 0;
  padding: 12px 12px 12px 14px;
  background: #fff;
  color: #111827;
  border: 1px solid #e5e7eb;
  border-radius: 12px;
  font: 14px/1.4 ui-sans-serif, system-ui, -apple-system, "Segoe UI", Roboto, Arial, sans-serif;
  position: relative;
  overflow: hidden;
  animation: app-notice-in 220ms ease-out;
}

@keyframes app-notice-in {
  from { opacity: 0; transform: translateY(-8px); }
  to { opacity: 1; transform: none; }
}

@media (prefers-reduced-motion: reduce) {
  .app-notice { animation: none; }
}

.app-notice-warning { background: #fffbeb; border-color: #fcd34d; }
.app-notice-error   { background: #fef2f2; border-color: #fecaca; }
.app-notice-success { background: #ecfdf5; border-color: #a7f3d0; }
.app-notice-info    { background: #f0f9ff; border-color: #bae6fd; }

.app-notice-text { margin: 0; flex: 1; white-space: pre-line; overflow-wrap: anywhere; }

.app-notice-close {
  flex: 0 0 auto;
  margin: 0;
  padding: 0 4px;
  border: 0;
  background: transparent;
  color: #6b7280;
  font: inherit;
  font-size: 18px;
  line-height: 1;
  cursor: pointer;
}

.app-notice-close:hover { color: #111827; }

.app-notice-timer {
  position: absolute;
  left: 0;
  bottom: 0;
  height: 2px;
  width: 100%;
  background: currentColor;
  opacity: 0.7;
  transform-origin: left center;
  animation: app-notice-timer 6s linear forwards;
}

.app-notice:hover .app-notice-timer { animation-play-state: paused; }

@keyframes app-notice-timer {
  from { transform: scaleX(1); }
  to { transform: scaleX(0); }
}
