/* toast.css — стиль уведомлений #toast-host + .toast (UI-kit B1, #100).
   Использует семантические токены из ifree-tokens.css. */

#toast-host {
  position: fixed;
  top: 1rem;
  right: 1rem;
  z-index: 9999;
  display: flex;
  flex-direction: column;
  gap: 0.5rem;
  pointer-events: none;     /* контейнер прозрачен для кликов; toast'ы сами ловят */
  max-width: min(28rem, calc(100vw - 2rem));
}

.toast {
  pointer-events: auto;
  display: flex;
  align-items: flex-start;
  gap: 0.625rem;
  padding: 0.75rem 0.875rem;
  background: var(--popover, var(--bg-twilight));
  color: var(--popover-foreground, var(--text-primary));
  border: 1px solid var(--border);
  border-left: 3px solid var(--info);
  border-radius: var(--radius-md, 10px);
  box-shadow: var(--shadow-overlay, 0 12px 40px -8px rgba(0,0,0,.45), 0 4px 12px -4px rgba(0,0,0,.30));
  font-size: 0.875rem;
  line-height: 1.4;
  /* Стартовое состояние — справа за экраном, прозрачное. */
  transform: translateX(110%);
  opacity: 0;
  transition: transform var(--dur-base, 250ms) var(--ease-out, cubic-bezier(0.16, 1, 0.3, 1)),
              opacity   var(--dur-base, 250ms) var(--ease-out, cubic-bezier(0.16, 1, 0.3, 1));
}

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

.toast.toast-exit {
  transform: translateX(110%);
  opacity: 0;
}

.toast-icon {
  flex: 0 0 1.25rem;
  width: 1.25rem; height: 1.25rem;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  border-radius: 9999px;
  font-weight: 700;
  font-size: 0.75rem;
  background: var(--info);
  color: var(--info-foreground, #fff);
  font-family: var(--font-mono, ui-monospace, Menlo, monospace);
}

.toast-body {
  flex: 1 1 auto;
  word-break: break-word;
}

.toast-close {
  flex: 0 0 auto;
  background: transparent;
  border: 0;
  color: var(--text-muted);
  font-size: 1.125rem;
  line-height: 1;
  cursor: pointer;
  padding: 0 0.125rem;
  margin-left: 0.25rem;
}
.toast-close:hover { color: var(--text-primary); }

/* ---- Type variants ---- */

.toast-success { border-left-color: var(--success); }
.toast-success .toast-icon { background: var(--success); color: var(--success-foreground, #fff); }

.toast-warning { border-left-color: var(--warning); }
.toast-warning .toast-icon { background: var(--warning); color: var(--warning-foreground, #fff); }

.toast-error { border-left-color: var(--destructive); }
.toast-error .toast-icon { background: var(--destructive); color: var(--destructive-foreground, #fff); }

.toast-info { border-left-color: var(--info); }
.toast-info .toast-icon { background: var(--info); color: var(--info-foreground, #fff); }
