/* Neutral frosted glass; status belongs to the solid leading rail and icon. */
#toast.typed-toast {
  --toast-accent: #0b5ff0;
  --toast-surface: #ffffff;
  --toast-ink: #182235;
  --toast-muted: #485468;
  --toast-glass-opacity: 80%;
  --toast-glass-highlight: #ffffffcc;
  --toast-top: max(56px, calc(var(--app-top-inset, env(safe-area-inset-top, 0px)) + 24px));
  top: var(--toast-top);
  bottom: auto;
  height: auto;
  min-height: 0;
  max-height: calc(100% - var(--toast-top) - 16px);
  min-width: 0;
  padding: 14px 16px;
  padding-inline-start: 20px;
  display: grid;
  grid-template-columns: 52px minmax(0, 1fr);
  align-items: center;
  gap: 12px;
  overflow: auto;
  border: 1px solid #ffffffb3;
  border-radius: 18px;
  background: var(--toast-surface);
  background: color-mix(in srgb, var(--toast-surface) var(--toast-glass-opacity), transparent);
  background-image: linear-gradient(125deg, #ffffff26, #ffffff00 65%);
  color: var(--toast-ink);
  box-shadow: inset 0 1px 0 var(--toast-glass-highlight), 0 10px 28px #1528441f, 0 2px 6px #1528440a;
  backdrop-filter: blur(24px) saturate(145%);
  -webkit-backdrop-filter: blur(24px) saturate(145%);
  direction: rtl;
  text-align: start;
  visibility: hidden;
  opacity: 0;
  pointer-events: none;
  touch-action: pan-x;
  cursor: grab;
  user-select: none;
  -webkit-user-select: none;
  transform: translateY(-10px);
  transition: opacity 180ms ease, transform 180ms ease, visibility 180ms;
}

#toast.typed-toast::before {
  content: "";
  position: absolute;
  top: 0;
  bottom: 0;
  right: 0;
  width: 6px;
  border-radius: 0 18px 18px 0;
  background: var(--toast-accent);
  pointer-events: none;
}

.phone #toast.typed-toast {
  position: absolute;
  inset-inline: 16px;
  width: auto;
  z-index: 90;
}

body > #toast.typed-toast {
  position: fixed;
  right: auto;
  left: 28px;
  width: min(420px, calc(100vw - 32px));
  z-index: 200;
}

#toast.typed-toast[data-toast-type="warning"] {
  --toast-accent: #c77700;
}

#toast.typed-toast[data-toast-type="success"] {
  --toast-accent: #078756;
}

#toast.typed-toast[data-toast-type="error"] {
  --toast-accent: #df304b;
}

#toast.typed-toast.show {
  visibility: visible;
  opacity: 1;
  transform: none;
  pointer-events: auto;
}

#toast.typed-toast.show.is-dragging {
  transform: translateY(var(--toast-drag-y, 0px));
  opacity: var(--toast-drag-opacity, 1);
  transition: none;
  cursor: grabbing;
}

#toast.typed-toast.is-swiped-away {
  transform: translateY(calc(-100% - var(--toast-top) - 24px));
}

#toast.typed-toast:focus-visible {
  outline: 2px solid var(--toast-accent);
  outline-offset: 3px;
}

#toast.typed-toast .toast-icon {
  width: 52px;
  height: 52px;
  display: grid;
  place-items: center;
  border-radius: 15px;
  background: var(--toast-accent);
  color: #ffffff;
  box-shadow: inset 0 1px 0 #ffffff30, 0 3px 8px #15284412;
}

#toast.typed-toast svg {
  width: 24px;
  height: 24px;
  fill: none;
  stroke: currentColor;
  stroke-width: 1.8;
  stroke-linecap: round;
  stroke-linejoin: round;
}

#toast.typed-toast .toast-content { min-width: 0; }

#toast.typed-toast .toast-icon svg { width: 32px; height: 32px; stroke-width: 2; }

#toast.typed-toast .toast-title {
  display: block;
  margin: 0;
  color: var(--toast-ink);
  font-family: "Vazirmatn SemiBold", Tahoma, sans-serif;
  font-size: var(--biz-text-body, 14px) !important;
  line-height: var(--biz-line-body, 24px);
}

#toast.typed-toast .toast-subtitle {
  margin: 2px 0 0;
  color: var(--toast-muted);
  font-family: "Vazirmatn Regular", Tahoma, sans-serif;
  font-size: var(--biz-text-caption, 12px) !important;
  line-height: var(--biz-line-caption, 20px);
  overflow-wrap: anywhere;
}

html[data-color-scheme="dark"] #toast.typed-toast {
  --toast-surface: #19212d;
  --toast-ink: #edf2f8;
  --toast-muted: #c2cddb;
  --toast-glass-opacity: 80%;
  --toast-glass-highlight: #ffffff20;
  background-image: linear-gradient(125deg, #ffffff0d, #ffffff00 65%);
  border-color: #ffffff24;
  box-shadow: inset 0 1px 0 var(--toast-glass-highlight), 0 12px 32px #0006;
}

@media (max-width: 360px) {
  #toast.typed-toast { padding: 12px; padding-inline-start: 18px; gap: 10px; }
}

@media (prefers-reduced-motion: reduce) {
  #toast.typed-toast { transition: none; }
  #toast.typed-toast:not(.is-dragging) { transform: none; }
}
