.flash-toast-region {
  position: fixed;
  top: calc(env(safe-area-inset-top, 0px) + 1rem);
  inset-inline: 0;
  z-index: 140;
  display: flex;
  justify-content: center;
  padding-inline: clamp(0.75rem, 3vw, 1.5rem);
  pointer-events: none;
}

.flash-toast-stack {
  display: grid;
  gap: 0.72rem;
  width: min(100%, 31rem);
  pointer-events: none;
}

.flash-toast {
  --flash-accent: #60a5fa;
  --flash-accent-strong: #1a4fd8;
  --flash-accent-soft: rgba(96, 165, 250, 0.16);
  --flash-border: rgba(96, 165, 250, 0.24);
  --flash-title: #e5e7eb;
  --flash-text: rgba(229, 236, 248, 0.78);
  --flash-panel: linear-gradient(160deg, rgba(18, 24, 38, 0.96), rgba(10, 13, 20, 0.94));
  --flash-duration: 6200ms;
  position: relative;
  display: grid;
  grid-template-columns: auto minmax(0, 1fr) auto;
  align-items: start;
  gap: 0.82rem;
  min-height: 4.7rem;
  overflow: hidden;
  padding: 0.95rem 0.95rem 1.08rem;
  border: 1px solid var(--flash-border);
  border-radius: 0.5rem;
  background:
    radial-gradient(circle at 100% 0, var(--flash-accent-soft), transparent 42%),
    var(--flash-panel);
  color: var(--flash-text);
  box-shadow:
    0 20px 44px rgba(2, 6, 23, 0.32),
    0 0 0 1px rgba(255, 255, 255, 0.04),
    inset 0 1px 0 rgba(255, 255, 255, 0.08);
  backdrop-filter: blur(18px);
  pointer-events: auto;
  transform-origin: top center;
  animation: flash-toast-enter 260ms cubic-bezier(0.22, 1, 0.36, 1) both;
}

.flash-toast::before {
  content: "";
  position: absolute;
  inset-block: 0;
  inset-inline-start: 0;
  width: 3px;
  background: linear-gradient(180deg, var(--flash-accent), var(--flash-accent-strong));
}

.flash-toast-success {
  --flash-accent: #10b981;
  --flash-accent-strong: #10b981;
  --flash-accent-soft: rgba(94, 224, 161, 0.17);
  --flash-border: rgba(94, 224, 161, 0.26);
}

.flash-toast-error {
  --flash-accent: #ef4444;
  --flash-accent-strong: #ef4444;
  --flash-accent-soft: rgba(255, 111, 132, 0.16);
  --flash-border: rgba(255, 111, 132, 0.28);
}

.flash-toast-warning {
  --flash-accent: #f59e0b;
  --flash-accent-strong: #1a4fd8;
  --flash-accent-soft: rgba(255, 209, 102, 0.18);
  --flash-border: rgba(255, 209, 102, 0.28);
}

.flash-toast-info,
.flash-toast-debug {
  --flash-accent: #60a5fa;
  --flash-accent-strong: #1a4fd8;
  --flash-accent-soft: rgba(141, 184, 255, 0.16);
  --flash-border: rgba(141, 184, 255, 0.24);
}

.flash-toast-icon {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 2.35rem;
  height: 2.35rem;
  border: 1px solid var(--flash-border);
  border-radius: 999px;
  background: var(--flash-accent-soft);
  color: var(--flash-accent);
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.08);
}

.flash-toast-icon svg {
  width: 1.1rem;
  height: 1.1rem;
  fill: none;
  stroke: currentColor;
  stroke-width: 2.2;
  stroke-linecap: round;
  stroke-linejoin: round;
}

.flash-toast-copy {
  min-width: 0;
  display: grid;
  gap: 0.12rem;
  padding-block-start: 0.04rem;
}

.flash-toast-copy strong {
  color: var(--flash-title);
  font-size: 0.92rem;
  font-weight: 800;
  line-height: 1.55;
}

.flash-toast-copy p {
  margin: 0;
  color: var(--flash-text);
  font-size: 0.86rem;
  line-height: 1.85;
  overflow-wrap: anywhere;
}

.flash-toast-close {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 2rem;
  height: 2rem;
  border: 1px solid rgba(255, 255, 255, 0.08);
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.06);
  color: rgba(239, 244, 255, 0.7);
  cursor: pointer;
  transition:
    transform 180ms ease,
    border-color 180ms ease,
    background-color 180ms ease,
    color 180ms ease;
}

.flash-toast-close:hover,
.flash-toast-close:focus-visible {
  border-color: var(--flash-border);
  background: var(--flash-accent-soft);
  color: var(--flash-title);
  transform: translateY(-1px);
}

.flash-toast-close svg {
  width: 0.92rem;
  height: 0.92rem;
  fill: currentColor;
}

.flash-toast-progress {
  position: absolute;
  inset-inline: 0;
  bottom: 0;
  height: 3px;
  background: rgba(255, 255, 255, 0.06);
}

.flash-toast-progress-bar {
  display: block;
  width: 100%;
  height: 100%;
  background: linear-gradient(90deg, var(--flash-accent), var(--flash-accent-strong));
  transform-origin: right center;
  animation: flash-toast-progress var(--flash-duration) linear forwards;
}

html[dir="ltr"] .flash-toast-progress-bar {
  transform-origin: left center;
}

.flash-toast.is-paused .flash-toast-progress-bar {
  animation-play-state: paused;
}

.flash-toast.is-leaving {
  pointer-events: none;
  animation: flash-toast-leave 220ms ease both;
}

:root[data-theme="light"] .flash-toast {
  --flash-title: #0b0d10;
  --flash-text: rgba(42, 54, 80, 0.78);
  --flash-panel: linear-gradient(160deg, rgba(255, 255, 255, 0.98), rgba(244, 248, 255, 0.95));
  box-shadow:
    0 18px 40px rgba(16, 32, 58, 0.14),
    0 0 0 1px rgba(255, 255, 255, 0.72),
    inset 0 1px 0 rgba(255, 255, 255, 0.84);
}

:root[data-theme="light"] .flash-toast-close {
  border-color: rgba(20, 34, 60, 0.08);
  background: rgba(20, 34, 60, 0.04);
  color: rgba(21, 32, 57, 0.62);
}

:root[data-theme="light"] .flash-toast-progress {
  background: rgba(20, 34, 60, 0.08);
}

@media (max-width: 767px) {
  .flash-toast-region {
    top: calc(env(safe-area-inset-top, 0px) + 0.72rem);
    padding-inline: 0.72rem;
  }

  .flash-toast {
    min-height: 4.45rem;
    gap: 0.68rem;
    padding: 0.82rem 0.82rem 1rem;
  }

  .flash-toast-icon {
    width: 2.12rem;
    height: 2.12rem;
  }
}

@media (prefers-reduced-motion: reduce) {
  .flash-toast,
  .flash-toast.is-leaving,
  .flash-toast-progress-bar {
    animation: none;
  }
}

@keyframes flash-toast-enter {
  from {
    opacity: 0;
    transform: translateY(-0.65rem) scale(0.98);
  }

  to {
    opacity: 1;
    transform: translateY(0) scale(1);
  }
}

@keyframes flash-toast-leave {
  to {
    opacity: 0;
    transform: translateY(-0.45rem) scale(0.98);
  }
}

@keyframes flash-toast-progress {
  from {
    transform: scaleX(1);
  }

  to {
    transform: scaleX(0);
  }
}

.baazax-toast-region.toast-center {
  position: fixed;
  top: calc(env(safe-area-inset-top, 0px) + 0.9rem);
  bottom: auto;
  inset-inline: 0;
  z-index: 1000;
  display: grid;
  justify-items: center;
  gap: 0.68rem;
  width: auto;
  padding-inline: clamp(0.7rem, 3vw, 1.35rem);
  pointer-events: none;
}

.baazax-toast-region .toast-card {
  --toast-accent: #60a5fa;
  --toast-accent-strong: #1a4fd8;
  --toast-accent-soft: rgba(141, 184, 255, 0.16);
  --toast-border: rgba(141, 184, 255, 0.24);
  --toast-panel: linear-gradient(160deg, rgba(18, 24, 38, 0.97), rgba(10, 13, 20, 0.94));
  width: min(100%, 31rem);
  max-width: calc(100vw - 1.4rem);
  pointer-events: auto;
  border-radius: 0.75rem;
  border-color: var(--toast-border);
  background:
    radial-gradient(circle at 100% 0, var(--toast-accent-soft), transparent 42%),
    var(--toast-panel);
  box-shadow:
    0 20px 44px rgba(2, 6, 23, 0.32),
    0 0 0 1px rgba(255, 255, 255, 0.04),
    inset 0 1px 0 rgba(255, 255, 255, 0.08);
  backdrop-filter: blur(18px);
}

.baazax-toast-region .toast-card::before {
  content: "";
  position: absolute;
  inset-block: 0;
  inset-inline-start: 0;
  width: 3px;
  background: linear-gradient(180deg, var(--toast-accent), var(--toast-accent-strong));
}

.baazax-toast-region .toast-card-message .toast-card-body {
  display: grid;
  grid-template-columns: auto minmax(0, 1fr);
  gap: 0.75rem;
  align-items: start;
  min-height: 4.2rem;
  padding: 0.86rem 0.9rem 0.96rem;
}

.baazax-toast-region .toast-card-message .toast-media {
  width: 2.35rem;
  height: 2.35rem;
  border-radius: 999px;
  background: var(--toast-accent-soft);
  border-color: var(--toast-border);
  color: var(--toast-accent);
}

.baazax-toast-region .toast-card-message .toast-media-fallback {
  color: currentColor;
  font-size: 0.95rem;
  font-weight: 950;
}

.baazax-toast-region .toast-card-message .toast-copy {
  gap: 0.08rem;
  padding-inline-end: 2rem;
}

.baazax-toast-region .toast-kicker {
  color: rgba(229, 236, 248, 0.66);
  letter-spacing: 0;
  text-transform: none;
}

.baazax-toast-region .toast-title {
  color: #e5e7eb;
  font-size: 0.92rem;
  font-weight: 900;
}

.baazax-toast-region .toast-product {
  color: rgba(229, 236, 248, 0.78);
  white-space: normal;
  overflow: visible;
  text-overflow: clip;
  font-size: 0.84rem;
  font-weight: 650;
  line-height: 1.8;
}

.baazax-toast-region .toast-close {
  top: 0.62rem;
  inset-inline-end: 0.62rem;
  width: 1.9rem;
  height: 1.9rem;
}

.baazax-toast-region .toast-card-success {
  --toast-accent: #10b981;
  --toast-accent-strong: #10b981;
  --toast-accent-soft: rgba(94, 224, 161, 0.17);
  --toast-border: rgba(94, 224, 161, 0.26);
}

.baazax-toast-region .toast-card-error {
  --toast-accent: #ef4444;
  --toast-accent-strong: #ef4444;
  --toast-accent-soft: rgba(255, 111, 132, 0.16);
  --toast-border: rgba(255, 111, 132, 0.28);
}

.baazax-toast-region .toast-card-warning {
  --toast-accent: #f59e0b;
  --toast-accent-strong: #1a4fd8;
  --toast-accent-soft: rgba(255, 209, 102, 0.18);
  --toast-border: rgba(255, 209, 102, 0.28);
}

.baazax-toast-region .toast-card-info {
  --toast-accent: #60a5fa;
  --toast-accent-strong: #1a4fd8;
  --toast-accent-soft: rgba(141, 184, 255, 0.16);
  --toast-border: rgba(141, 184, 255, 0.24);
}

.baazax-toast-region .toast-progress-bar-success,
.baazax-toast-region .toast-progress-bar-error,
.baazax-toast-region .toast-progress-bar-warning,
.baazax-toast-region .toast-progress-bar-info {
  background: linear-gradient(90deg, var(--toast-accent), var(--toast-accent-strong));
}

:root[data-theme="light"] .baazax-toast-region .toast-card {
  --toast-panel: linear-gradient(160deg, rgba(255, 255, 255, 0.98), rgba(244, 248, 255, 0.95));
  box-shadow:
    0 18px 40px rgba(16, 32, 58, 0.14),
    0 0 0 1px rgba(255, 255, 255, 0.72),
    inset 0 1px 0 rgba(255, 255, 255, 0.84);
}

:root[data-theme="light"] .baazax-toast-region .toast-title {
  color: #0b0d10;
}

:root[data-theme="light"] .baazax-toast-region .toast-product {
  color: rgba(42, 54, 80, 0.78);
}

:root[data-theme="light"] .baazax-toast-region .toast-kicker {
  color: rgba(42, 54, 80, 0.58);
}

@media (max-width: 767px) {
  .baazax-toast-region.toast-center {
    top: calc(env(safe-area-inset-top, 0px) + 0.55rem);
    padding-inline: 0.62rem;
  }

  .baazax-toast-region .toast-card {
    width: min(100%, 26rem);
  }

  .baazax-toast-region .toast-card-message .toast-card-body {
    min-height: 3.65rem;
    gap: 0.6rem;
    padding: 0.7rem 0.72rem 0.82rem;
  }

  .baazax-toast-region .toast-card-message .toast-media {
    width: 2rem;
    height: 2rem;
  }

  .baazax-toast-region .toast-kicker {
    display: none;
  }

  .baazax-toast-region .toast-title {
    font-size: 0.86rem;
  }

  .baazax-toast-region .toast-product {
    font-size: 0.78rem;
    line-height: 1.65;
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
    overflow: hidden;
  }
}
