#ot-toast-host {
  display: flex;
  flex-direction: column-reverse;
  gap: 0.625rem;
}

.ot-toast {
  pointer-events: auto;
  display: grid;
  gap: 0.875rem;
  width: 100%;
  padding: 0.875rem 1rem;
  border-radius: 1rem;
  border: 1px solid rgb(228 228 231 / 0.9);
  background: rgb(255 255 255 / 0.97);
  color: rgb(24 24 27);
  box-shadow:
    0 1px 2px rgb(24 31 42 / 0.04),
    0 12px 40px rgb(24 31 42 / 0.12);
  backdrop-filter: blur(12px);
  opacity: 0;
  transform: translate3d(0, 14px, 0) scale(0.97);
  transition:
    opacity 280ms cubic-bezier(0.22, 1, 0.36, 1),
    transform 280ms cubic-bezier(0.22, 1, 0.36, 1);
  will-change: opacity, transform;
}

.ot-toast.is-visible {
  opacity: 1;
  transform: translate3d(0, 0, 0) scale(1);
}

.ot-toast.is-leaving {
  opacity: 0;
  transform: translate3d(0, 8px, 0) scale(0.98);
  transition-duration: 200ms;
}

.ot-toast--success {
  border-color: rgb(167 243 208 / 0.9);
  box-shadow:
    0 1px 2px rgb(16 185 129 / 0.06),
    0 12px 40px rgb(16 185 129 / 0.12);
}

.ot-toast--error {
  border-color: rgb(254 202 202 / 0.95);
  box-shadow:
    0 1px 2px rgb(239 68 68 / 0.06),
    0 12px 40px rgb(239 68 68 / 0.1);
}

.ot-toast--info {
  border-color: rgb(191 219 254 / 0.95);
  box-shadow:
    0 1px 2px rgb(59 130 246 / 0.05),
    0 12px 40px rgb(59 130 246 / 0.1);
}

.ot-toast__icon {
  display: grid;
  place-items: center;
  flex-shrink: 0;
  width: 2.25rem;
  height: 2.25rem;
  border-radius: 0.75rem;
}

.ot-toast--success .ot-toast__icon {
  background: rgb(236 253 245);
  color: rgb(5 150 105);
}

.ot-toast--error .ot-toast__icon {
  background: rgb(254 242 242);
  color: rgb(220 38 38);
}

.ot-toast--info .ot-toast__icon {
  background: rgb(239 246 255);
  color: rgb(37 99 235);
}

.ot-toast--neutral .ot-toast__icon {
  background: rgb(244 244 245);
  color: rgb(82 82 91);
}

.ot-toast__spinner {
  animation: ot-toast-spin 0.85s linear infinite;
}

@keyframes ot-toast-spin {
  to {
    transform: rotate(360deg);
  }
}

.ot-toast__url {
  display: block;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  font-size: 0.75rem;
  font-weight: 500;
  color: rgb(37 99 235);
  text-decoration: none;
}

.ot-toast__url:hover {
  color: rgb(29 78 216);
  text-decoration: underline;
  text-underline-offset: 2px;
}

.ot-toast__actions {
  display: flex;
  flex-wrap: wrap;
  gap: 0.5rem;
  padding-left: 2.75rem;
}

.ot-toast__btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  height: 2rem;
  padding: 0 0.75rem;
  font-size: 0.75rem;
  font-weight: 700;
  border-radius: 0.625rem;
  transition: background-color 150ms ease, color 150ms ease, border-color 150ms ease;
}

.ot-toast__btn--primary {
  color: white;
  background: rgb(24 24 27);
  border: 1px solid rgb(24 24 27);
}

.ot-toast__btn--primary:hover {
  background: rgb(39 39 42);
}

.ot-toast__btn--secondary {
  color: rgb(24 24 27);
  background: white;
  border: 1px solid rgb(228 228 231);
}

.ot-toast__btn--secondary:hover {
  background: rgb(250 250 250);
}

.ot-toast__close {
  display: grid;
  place-items: center;
  width: 1.75rem;
  height: 1.75rem;
  color: rgb(161 161 170);
  border-radius: 0.5rem;
  transition: background-color 150ms ease, color 150ms ease;
}

.ot-toast__close:hover {
  color: rgb(24 24 27);
  background: rgb(244 244 245);
}

.ot-toast__title {
  margin: 0;
  font-size: 0.8125rem;
  font-weight: 700;
  letter-spacing: -0.01em;
  color: rgb(24 24 27);
}

.ot-toast__message {
  margin: 0;
  font-size: 0.8125rem;
  line-height: 1.45;
  color: rgb(82 82 91);
}

.ot-toast__body {
  display: grid;
  flex: 1;
  gap: 0.35rem;
  min-width: 0;
}

.ot-toast__header {
  display: flex;
  gap: 0.5rem;
  align-items: flex-start;
  justify-content: space-between;
}

.ot-toast__row {
  display: flex;
  gap: 0.75rem;
  align-items: flex-start;
}

/* Dark theme */
.dark .ot-toast {
  background: rgb(24 24 27 / 0.97);
  border-color: rgb(63 63 70 / 0.9);
  color: #e4e4e7;
}

/* Text — the title was hard-coded near-black, invisible on the dark surface. */
.dark .ot-toast__title {
  color: #f4f4f5;
}

.dark .ot-toast__message {
  color: #a1a1aa;
}

.dark .ot-toast__close {
  color: #71717a;
}

.dark .ot-toast__close:hover {
  color: #f4f4f5;
  background: rgb(63 63 70 / 0.6);
}

/* Icon chips — soften the bright light-tinted circles into subtle dark tints. */
.dark .ot-toast--success .ot-toast__icon {
  background: rgb(5 150 105 / 0.16);
  color: #6ee7b7;
}

.dark .ot-toast--error .ot-toast__icon {
  background: rgb(220 38 38 / 0.16);
  color: #fca5a5;
}

.dark .ot-toast--info .ot-toast__icon {
  background: rgb(37 99 235 / 0.16);
  color: #93c5fd;
}

.dark .ot-toast--neutral .ot-toast__icon {
  background: rgb(82 82 91 / 0.22);
  color: #d4d4d8;
}

/* Status borders on the toast shell — match the tinted icon, not a light ring. */
.dark .ot-toast--success {
  border-color: rgb(5 150 105 / 0.4);
}

.dark .ot-toast--error {
  border-color: rgb(220 38 38 / 0.4);
}

.dark .ot-toast--info {
  border-color: rgb(37 99 235 / 0.4);
}

/* Action buttons + link (Bluesky "Open"/"Copy") */
.dark .ot-toast__url {
  color: #93c5fd;
}

.dark .ot-toast__url:hover {
  color: #bfdbfe;
}

.dark .ot-toast__btn--primary {
  color: #0a0a0c;
  background: #f4f4f5;
  border-color: #f4f4f5;
}

.dark .ot-toast__btn--primary:hover {
  background: #e4e4e7;
}

.dark .ot-toast__btn--secondary {
  color: #e4e4e7;
  background: rgb(63 63 70 / 0.4);
  border-color: rgb(63 63 70 / 0.9);
}

.dark .ot-toast__btn--secondary:hover {
  background: rgb(63 63 70 / 0.7);
}
