.platform-toast-region {
  position: fixed;
  z-index: 10050;
  top: 88px;
  right: 24px;
  display: flex;
  width: min(420px, calc(100vw - 48px));
  flex-direction: column;
  gap: 12px;
  pointer-events: none;
}

.platform-toast {
  --platform-toast-accent: var(--platform-accent-strong, #3c66e8);
  position: relative;
  display: grid;
  overflow: hidden;
  box-sizing: border-box;
  grid-template-columns: 38px minmax(0, 1fr) 28px;
  gap: 12px;
  align-items: start;
  min-height: 82px;
  padding: 16px 14px 17px 16px;
  border: 1px solid var(--platform-panel-border, #1b2958);
  border-radius: 14px;
  background: var(--platform-surface-raised, linear-gradient(180deg, #0d1532 0%, #090f24 100%));
  box-shadow: var(--platform-shadow-strong, 0 16px 40px rgba(3, 8, 24, 0.32));
  color: var(--platform-text, #e5edff);
  cursor: pointer;
  opacity: 0;
  pointer-events: auto;
  touch-action: pan-y;
  transform: translate3d(-36px, 0, 0);
  transition:
    opacity 180ms ease-out,
    transform 220ms ease-out;
  user-select: none;
  will-change: transform, opacity;
}

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

.platform-toast.is-leaving {
  opacity: 0;
  transform: translate3d(-24px, 0, 0);
  transition-duration: 140ms;
}

.platform-toast.is-dragging {
  opacity: var(--platform-toast-swipe-opacity, 1);
  transform: translate3d(var(--platform-toast-swipe-x, 0), 0, 0);
  transition: none;
}

.platform-toast.is-swipe-dismissed {
  opacity: 0;
  transform: translate3d(-115%, 0, 0);
  transition:
    opacity 150ms ease-out,
    transform 180ms ease-out;
}

.platform-toast--success {
  --platform-toast-accent: var(--platform-success, #22c55e);
}

.platform-toast--success .platform-toast__icon svg {
  width: 18px;
  height: 18px;
  stroke-width: 2;
}

.platform-toast--warning {
  --platform-toast-accent: #f0a43c;
}

.platform-toast--error {
  --platform-toast-accent: var(--platform-danger, #ef5350);
}

.platform-toast__icon {
  display: inline-flex;
  width: 32px;
  height: 32px;
  box-sizing: border-box;
  margin: 3px 0;
  align-items: center;
  justify-content: center;
  justify-self: center;
  border: 1px solid color-mix(in srgb, var(--platform-toast-accent) 22%, transparent);
  border-radius: 9px;
  background: color-mix(in srgb, var(--platform-toast-accent) 8%, transparent);
  color: var(--platform-toast-accent);
}

.platform-toast__icon svg {
  width: 20px;
  height: 20px;
  fill: none;
  stroke: currentColor;
  stroke-linecap: round;
  stroke-linejoin: round;
  stroke-width: 2;
}

.platform-toast__content {
  min-width: 0;
  padding-top: 1px;
}

.platform-toast__title {
  margin: 0;
  color: var(--platform-text-strong, #f5f8ff);
  font-size: 15px;
  font-weight: 600;
  line-height: 1.35;
}

.platform-toast__message {
  margin: 5px 0 0;
  color: var(--platform-text-muted, #7f90c0);
  font-size: 13px;
  font-weight: 400;
  line-height: 1.45;
  overflow-wrap: anywhere;
}

.platform-toast__close {
  display: inline-flex;
  width: 28px;
  height: 28px;
  margin: 0 -4px 0 0;
  padding: 0;
  align-self: center;
  align-items: center;
  justify-content: center;
  border: 0;
  border-radius: 8px;
  background: transparent;
  box-shadow: none;
  color: var(--platform-text-muted, #7f90c0);
  cursor: pointer;
  transition: background-color 150ms ease, color 150ms ease;
}

.platform-toast__close:hover,
.platform-toast__close:focus-visible {
  background: var(--platform-accent-soft, rgba(52, 87, 200, 0.18));
  color: var(--platform-text-strong, #f5f8ff);
  outline: none;
}

.platform-toast__close svg {
  width: 16px;
  height: 16px;
  fill: none;
  stroke: currentColor;
  stroke-linecap: round;
  stroke-width: 2;
}

.platform-toast__progress {
  position: absolute;
  right: 0;
  bottom: 0;
  left: 0;
  height: 2px;
  background: color-mix(in srgb, var(--platform-toast-accent) 80%, transparent);
  transform: scaleX(1);
  transform-origin: left center;
  animation: platform-toast-progress var(--platform-toast-duration, 6000ms) linear forwards;
}

.platform-toast.is-paused .platform-toast__progress {
  animation-play-state: paused;
}

@keyframes platform-toast-progress {
  to {
    transform: scaleX(0);
  }
}

@media (max-width: 767px) {
  .platform-toast-region {
    top: 72px;
    right: 12px;
    left: 12px;
    width: auto;
    gap: 9px;
  }

  .platform-toast {
    min-height: 74px;
    grid-template-columns: 34px minmax(0, 1fr) 26px;
    gap: 10px;
    padding: 14px 12px 15px 14px;
    border-radius: 12px;
  }

  .platform-toast__icon {
    margin: 1px 0;
  }
}

@media (prefers-reduced-motion: reduce) {
  .platform-toast {
    transition: opacity 1ms linear;
    transform: none;
  }

  .platform-toast.is-leaving {
    transform: none;
  }

  .platform-toast__progress {
    animation: none;
  }
}
