/* NFT Zone — Frost Pill+ (Refined). Keep visuals faithful to the approved prototype. */
.toast-container {
  position: fixed;
  right: calc(24px + env(safe-area-inset-right, 0px));
  bottom: calc(24px + env(safe-area-inset-bottom, 0px) + var(--toast-viewport-bottom, 0px));
  z-index: 9999;
  display: flex;
  flex-direction: column;
  align-items: flex-end;
  gap: 10px;
  pointer-events: none;
}

.toast {
  --frost-glass: rgba(19, 25, 40, .89);
  --frost-border: linear-gradient(110deg,
    rgba(174, 128, 250, .77),
    rgba(115, 105, 231, .57) 51%,
    rgba(105, 202, 241, .72));
  --frost-shadow:
    0 15px 38px rgba(0, 0, 0, .30),
    inset 0 1px rgba(255, 255, 255, .085),
    0 0 22px -13px rgba(143, 97, 245, .33);
  --frost-hover-shadow:
    0 18px 42px rgba(0, 0, 0, .34),
    inset 0 1px rgba(255, 255, 255, .1),
    0 0 24px -13px rgba(143, 97, 245, .38);
  --frost-hair: rgba(255, 255, 255, .1);
  --toast-ink: #57dab0;
  position: relative;
  isolation: isolate;
  pointer-events: auto;
  display: grid;
  grid-template-columns: 18px minmax(0, 1fr) 28px;
  align-items: center;
  column-gap: 11px;
  width: min(354px, calc(100vw - 48px - env(safe-area-inset-left, 0px) - env(safe-area-inset-right, 0px)));
  height: 48px;
  padding: 0 9px 0 14px;
  color: var(--text-primary);
  border: 1px solid transparent;
  border-radius: 13px;
  background:
    linear-gradient(114deg,
      color-mix(in srgb, var(--frost-glass) 91%, rgba(151, 91, 244, .5) 9%),
      color-mix(in srgb, var(--frost-glass) 94%, rgba(63, 179, 238, .5) 6%)) padding-box,
    var(--frost-border) border-box;
  box-shadow: var(--frost-shadow);
  -webkit-backdrop-filter: blur(14px) saturate(112%);
  backdrop-filter: blur(14px) saturate(112%);
  overflow: hidden;
  transition: box-shadow .18s ease;
  animation: toast-frost-in .28s cubic-bezier(.16, 1, .28, 1) both;
}

.toast:hover,
.toast:focus-within {
  box-shadow: var(--frost-hover-shadow);
}

.toast::before {
  content: "";
  pointer-events: none;
  position: absolute;
  inset: 0;
  background:
    radial-gradient(ellipse at 5% 0%, rgba(157, 106, 247, .19), transparent 55%),
    radial-gradient(ellipse at 100% 100%, rgba(62, 165, 232, .10), transparent 52%),
    linear-gradient(160deg, rgba(255, 255, 255, .065), transparent 48%);
  z-index: -1;
}

.toast.toast-success { --toast-ink: #57dab0; }
.toast.toast-error { --toast-ink: #fb728b; }
.toast.toast-warning { --toast-ink: #f4ba57; }
.toast.toast-info { --toast-ink: #06b6d4; }
.toast.toast-copy { --toast-ink: #b18fff; }

.toast-icon-wrap {
  width: 18px;
  height: 18px;
  color: var(--toast-ink);
  display: grid;
  place-items: center;
}
.toast-icon-wrap svg {
  display: block;
  width: 17px;
  height: 17px;
  stroke: currentColor;
  stroke-width: 2.25;
  fill: none;
  stroke-linecap: round;
  stroke-linejoin: round;
}

.toast-message {
  min-width: 0;
  overflow: hidden;
  white-space: nowrap;
  text-overflow: ellipsis;
  color: var(--text-primary);
  font: 700 12px/1.2 var(--font-sans);
  letter-spacing: -.015em;
}

.toast-close-btn {
  display: grid;
  place-items: center;
  justify-self: end;
  flex: none;
  width: 28px;
  height: 28px;
  padding: 0;
  border: 1px solid var(--frost-hair);
  border-radius: 8px;
  color: var(--text-secondary);
  background: color-mix(in srgb, var(--bg-surface-2) 40%, transparent);
  cursor: pointer;
  transition: border-color .18s, color .18s, background .18s;
}
.toast-close-btn svg {
  display: block;
  width: 14px;
  height: 14px;
  stroke: currentColor;
  stroke-width: 1.85;
  fill: none;
  stroke-linecap: round;
  stroke-linejoin: round;
}
.toast-close-btn:hover {
  color: var(--text-primary);
  border-color: color-mix(in srgb, var(--accent-violet) 38%, var(--frost-hair));
  background: color-mix(in srgb, var(--bg-surface-2) 75%, transparent);
}
.toast-close-btn:focus-visible {
  outline: 2px solid var(--accent-cyan);
  outline-offset: 2px;
}

.toast-progress {
  position: absolute;
  height: 2px;
  bottom: 0;
  left: 0;
  right: 0;
  transform-origin: left;
  background: linear-gradient(90deg, #aa74fb, #6e8df2, #73d0f0);
  opacity: .95;
  animation: toast-frost-progress var(--toast-duration, 3500ms) linear forwards;
}
.toast.dismissing { animation: toast-frost-out .2s ease forwards; }

[data-theme="light"] .toast {
  --frost-glass: rgba(255, 255, 255, .94);
  --frost-border: linear-gradient(110deg,
    rgba(171, 127, 242, .56),
    rgba(95, 167, 226, .50));
  --frost-shadow:
    0 4px 12px rgba(48, 68, 111, .055),
    inset 0 1px rgba(255, 255, 255, .45);
  --frost-hover-shadow:
    0 6px 16px rgba(48, 68, 111, .075),
    inset 0 1px rgba(255, 255, 255, .5);
  --frost-hair: rgba(19, 32, 57, .10);
}
[data-theme="light"] .toast::before {
  background:
    radial-gradient(ellipse at 5% 0%, rgba(157, 106, 247, .035), transparent 55%),
    radial-gradient(ellipse at 100% 100%, rgba(62, 165, 232, .02), transparent 52%),
    linear-gradient(160deg, rgba(255, 255, 255, .22), transparent 48%);
}
[data-theme="light"] .toast.toast-success { --toast-ink: #059669; }
[data-theme="light"] .toast.toast-error { --toast-ink: #d92953; }
[data-theme="light"] .toast.toast-warning { --toast-ink: #b96b00; }
[data-theme="light"] .toast.toast-info { --toast-ink: #0284c7; }
[data-theme="light"] .toast.toast-copy { --toast-ink: #6e38dc; }

@keyframes toast-frost-in {
  from { opacity: 0; transform: translateY(12px) scale(.98); }
  to { opacity: 1; transform: translateY(0) scale(1); }
}
@keyframes toast-frost-out {
  to { opacity: 0; transform: translateY(9px) scale(.98); }
}
@keyframes toast-frost-progress {
  from { transform: scaleX(1); }
  to { transform: scaleX(0); }
}

@media (max-width: 520px) {
  .toast-container {
    left: calc(12px + env(safe-area-inset-left, 0px));
    right: calc(12px + env(safe-area-inset-right, 0px));
    bottom: calc(12px + env(safe-area-inset-bottom, 0px) + var(--toast-viewport-bottom, 0px));
    align-items: stretch;
  }
  .toast { width: 100%; }
}

@media (prefers-reduced-motion: reduce) {
  .toast, .toast.dismissing, .toast-progress { animation: none; }
  .toast, .toast-close-btn { transition: none; }
}
