@layer components {
/* ── Toast ─────────────────────────────────────────────── */
.toast-region {
  position: fixed;
  right: 16px;
  bottom: 16px;
  left: auto;
  top: auto;
  margin: 0;
  padding: 0;
  border: 0;
  background: transparent;
  width: auto;
  max-width: calc(100vw - 32px);
  overflow: visible;
  display: flex;
  flex-direction: column;
  align-items: flex-end;
  gap: 8px;
  z-index: 1000;
  pointer-events: none;
}

.toast {
  pointer-events: auto;
  touch-action: none;
  user-select: none;
  cursor: pointer;
  display: flex;
  align-items: flex-start;
  gap: 12px;
  width: 360px;
  max-width: 100%;
  padding: 14px 16px;
  background: var(--surface);
  border: 1px solid var(--border);
  border-top: 3px solid var(--border);
  border-radius: var(--r-md);
  box-shadow: 0 10px 30px -10px oklch(20% 0.04 65 / 0.18);
  font-size: 14px;
  color: var(--text);
  transform: translateY(12px);
  opacity: 0;
  transition: transform 0.25s cubic-bezier(0.34, 1.56, 0.64, 1),
              opacity 0.2s ease-out;
}
.toast[data-state="open"]   { transform: translateY(0); opacity: 1; }
.toast[data-state="closed"] { transform: translateY(12px); opacity: 0; }

.toast--info    { border-top-color: var(--lavender-dot); }
.toast--success { border-top-color: var(--sage-dot); }
.toast--warning { border-top-color: var(--peach-dot); }
.toast--error   { border-top-color: var(--rose-dot); }

.toast-icon {
  width: 18px;
  height: 18px;
  flex-shrink: 0;
  margin-top: 1px;
}
.toast--info    .toast-icon { color: var(--lavender-fg); }
.toast--success .toast-icon { color: var(--sage-fg); }
.toast--warning .toast-icon { color: var(--peach-fg); }
.toast--error   .toast-icon { color: var(--rose-fg); }

.toast-message {
  flex: 1;
  margin: 0;
  font-weight: 500;
  line-height: 1.4;
}

.toast-close {
  flex-shrink: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  width: 22px;
  height: 22px;
  padding: 0;
  background: transparent;
  border: 0;
  color: var(--muted);
  border-radius: var(--r-sm);
  cursor: pointer;
  transition: background var(--t), color var(--t);
}
.toast-close:hover { background: var(--bg); color: var(--text); }
.toast-close-icon { width: 14px; height: 14px; }

@media (max-width: 480px) {
  .toast-region { right: 12px; left: 12px; align-items: stretch; }
  .toast { width: 100%; }
}
}
