/* ---------- Stacking notification toasts (js/core/toast.js) ----------
 * Fixed container in the bottom-right, above the bottom app bar. Toasts stack
 * vertically (newest on top); each fades out on its own timer. Distinct from
 * the undo toast (singleton, bottom-centre) and the celebration toast. */

.toast-stack {
  position: fixed;
  right: 16px;
  bottom: calc(var(--app-bar-h) + 12px);
  z-index: 10002;
  display: flex;
  flex-direction: column;
  gap: 8px;
  align-items: flex-end;
  max-width: min(360px, calc(100vw - 32px));
  pointer-events: none; /* container is transparent to clicks */
}

.toast {
  pointer-events: auto; /* individual toasts are interactive */
  display: flex;
  align-items: center;
  gap: 10px;
  background: var(--surface);
  color: var(--text);
  border: 1px solid var(--border);
  border-left: 3px solid var(--accent);
  border-radius: var(--radius-md);
  padding: 10px 14px;
  font-size: 0.875rem;
  line-height: 1.35;
  box-shadow: 0 8px 24px rgba(0, 0, 0, 0.22);
  opacity: 0;
  transform: translateX(16px);
  transition: opacity 0.22s ease, transform 0.22s ease;
}

.toast--in {
  opacity: 1;
  transform: translateX(0);
}

/* Tone accents (left border colour) so upload vs download read at a glance. */
.toast--upload { border-left-color: var(--accent); }
.toast--download { border-left-color: #22c55e; }
.toast--info { border-left-color: var(--border); }

.toast__icon {
  font-size: 1.05rem;
  line-height: 1;
  flex: 0 0 auto;
}

.toast__msg {
  flex: 1 1 auto;
  min-width: 0;
  word-break: break-word;
}

.toast__btn {
  flex: 0 0 auto;
  font: inherit;
  font-size: 0.8rem;
  font-weight: 600;
  color: var(--on-accent, #fff);
  background: var(--accent);
  border: none;
  border-radius: var(--radius-sm);
  padding: 5px 12px;
  cursor: pointer;
}

.toast__btn:hover {
  filter: brightness(1.08);
}

/* Mobile: the bottom app bar is 52px (not 56px), and we keep a little more
   breathing room. Loaded before mobile.css, so this still applies. */
@media (max-width: 768px) {
  .toast-stack {
    right: 12px;
    left: 12px;
    bottom: calc(52px + 12px);
    align-items: stretch;
    max-width: none;
  }
  .toast {
    width: 100%;
  }
}

