#rabino-toast-container {
  --rabino-toast-success: #16a34a;
  --rabino-toast-error: #dc2626;
  --rabino-toast-info: #334155;
  --rabino-toast-spinner: #ef4444;
  --rabino-toast-radius: 12px;
  --rabino-toast-radius-sm: 8px;
  --rabino-toast-radius-lg: 16px;
  --rabino-toast-text: #ffffff;
  --rabino-toast-border: rgba(255, 255, 255, 0.16);
  --rabino-toast-shadow: 0 16px 38px -18px rgba(15, 23, 42, 0.52),
    0 8px 18px -12px rgba(15, 23, 42, 0.32);
  --rabino-toast-space-xs: 4px;
  --rabino-toast-space-sm: 8px;
  --rabino-toast-space-md: 12px;
  --rabino-toast-space-lg: 16px;
  --rabino-toast-duration: 4s;

  position: fixed;
  top: max(24px, env(safe-area-inset-top));
  right: max(24px, env(safe-area-inset-right));
  z-index: 2000000050;
  display: flex;
  width: min(420px, calc(100vw - 48px));
  max-height: calc(100vh - 48px - env(safe-area-inset-top));
  flex-direction: column;
  gap: var(--rabino-toast-space-md);
  overflow: visible;
  pointer-events: none;
  direction: inherit;
  color-scheme: light;
  font-family: var(--rabino-toast-font-family, inherit);
  text-align: start;
}

.rabino-toast {
  position: relative;
  display: grid;
  grid-template-columns: 34px minmax(0, 1fr) 36px;
  align-items: center;
  gap: var(--rabino-toast-space-md);
  width: 100%;
  min-width: 0;
  padding: 13px var(--rabino-toast-space-lg);
  overflow: hidden;
  border: 1px solid var(--rabino-toast-border);
  border-radius: var(--rabino-toast-radius);
  background: var(--rabino-toast-info);
  box-shadow: var(--rabino-toast-shadow);
  color: var(--rabino-toast-text);
  font-family: var(--rabino-toast-font-family, inherit);
  font-size: 14px;
  font-weight: 500;
  line-height: 1.65;
  opacity: 0;
  pointer-events: auto;
  transform: translateX(36px) scale(0.98);
  transform-origin: top right;
  transition: opacity 220ms ease, transform 300ms cubic-bezier(0.22, 1, 0.36, 1),
    box-shadow 180ms ease;
  will-change: transform, opacity;
}

[dir="ltr"] .rabino-toast {
  transform-origin: top left;
}

.rabino-toast--success {
  background: var(--rabino-toast-success);
}

.rabino-toast--error {
  background: var(--rabino-toast-error);
}

.rabino-toast--info {
  background: var(--rabino-toast-info);
}

.rabino-toast.is-visible {
  opacity: 1;
  transform: translateX(0) scale(1);
}

.rabino-toast.is-visible:hover,
.rabino-toast.is-visible:focus-within {
  box-shadow: 0 20px 44px -18px rgba(15, 23, 42, 0.62),
    0 10px 22px -14px rgba(15, 23, 42, 0.4);
}

.rabino-toast.is-hiding {
  opacity: 0;
  pointer-events: none;
  transform: translateY(-6px) scale(0.97);
}

.rabino-toast__icon {
  display: inline-flex;
  width: 34px;
  height: 34px;
  align-items: center;
  justify-content: center;
  border: 1px solid rgba(255, 255, 255, 0.18);
  border-radius: 50%;
  background: rgba(255, 255, 255, 0.14);
  flex: 0 0 auto;
}

.rabino-toast__icon svg {
  display: block;
  width: 18px;
  height: 18px;
  fill: none;
  stroke: currentColor;
  stroke-width: 2.4;
  vector-effect: non-scaling-stroke;
}

.rabino-toast__message {
  min-width: 0;
  overflow-wrap: anywhere;
  white-space: pre-line;
  word-break: normal;
}

.rabino-toast__close {
  display: inline-flex;
  width: 36px;
  height: 36px;
  align-items: center;
  justify-content: center;
  justify-self: end;
  margin: -4px;
  padding: 0;
  border: 0;
  border-radius: var(--rabino-toast-radius-sm);
  background: transparent;
  box-shadow: none;
  color: rgba(255, 255, 255, 0.78);
  cursor: pointer;
  font: inherit;
  line-height: 1;
  appearance: none;
  -webkit-appearance: none;
  transition: color 160ms ease, background-color 160ms ease,
    box-shadow 160ms ease;
}

.rabino-toast__close:hover {
  background: rgba(255, 255, 255, 0.14);
  color: #ffffff;
}

.rabino-toast__close:focus-visible {
  outline: 2px solid #ffffff;
  outline-offset: 2px;
  background: rgba(255, 255, 255, 0.14);
  color: #ffffff;
}

.rabino-toast__close svg {
  display: block;
  width: 16px;
  height: 16px;
  fill: none;
  stroke: currentColor;
  stroke-width: 2.2;
}

.rabino-toast__progress {
  position: absolute;
  right: 0;
  bottom: 0;
  left: 0;
  width: 100%;
  height: 3px;
  background: rgba(255, 255, 255, 0.7);
  pointer-events: none;
  transform: scaleX(1);
  transform-origin: right center;
}

[dir="ltr"] .rabino-toast__progress {
  transform-origin: left center;
}

/* Added only after JavaScript has safely captured a specific notice. */
.rabino-toast-native-captured {
  display: none !important;
}

.rabino-remove-spinner-overlay {
  position: absolute;
  inset: 0;
  z-index: 999999;
  display: flex;
  align-items: center;
  justify-content: center;
  overflow: hidden;
  border-radius: inherit;
  opacity: 0;
  pointer-events: none;
  transition: opacity 180ms ease;
}

.rabino-remove-spinner-overlay.is-active {
  opacity: 1;
}

.rabino-remove-spinner-overlay::before {
  position: absolute;
  inset: 0;
  border-radius: inherit;
  background: rgba(255, 255, 255, 0.78);
  backdrop-filter: blur(2px);
  content: "";
  -webkit-backdrop-filter: blur(2px);
}

.rabino-remove-spinner-ring {
  position: relative;
  z-index: 2;
  width: 36px;
  height: 36px;
}

.rabino-remove-spinner-ring::before,
.rabino-remove-spinner-ring::after {
  position: absolute;
  inset: 0;
  border: 3px solid transparent;
  border-radius: 50%;
  content: "";
}

.rabino-remove-spinner-ring::before {
  border-top-color: var(--rabino-spinner-color, var(--rabino-toast-spinner));
  border-right-color: var(--rabino-spinner-color, var(--rabino-toast-spinner));
  animation: rabino-toast-spin-outer 0.8s cubic-bezier(0.6, 0.15, 0.35, 0.85)
    infinite;
}

.rabino-remove-spinner-ring::after {
  inset: 5px;
  border-bottom-color: var(--rabino-spinner-color, var(--rabino-toast-spinner));
  border-left-color: var(--rabino-spinner-color, var(--rabino-toast-spinner));
  animation: rabino-toast-spin-inner 0.6s cubic-bezier(0.6, 0.15, 0.35, 0.85)
    infinite reverse;
}

.rabino-remove-spinner-dot {
  position: absolute;
  z-index: 3;
  top: 50%;
  left: 50%;
  width: 6px;
  height: 6px;
  margin: -3px 0 0 -3px;
  border-radius: 50%;
  animation: rabino-toast-pulse 0.8s ease-in-out infinite;
  background: var(--rabino-spinner-color, var(--rabino-toast-spinner));
}

.rabino-remove-disabled {
  cursor: wait !important;
  filter: grayscale(0.25);
  opacity: 0.46 !important;
}

.rabino-cart-item-removing {
  opacity: 0.3 !important;
  pointer-events: none !important;
  transform: scale(0.98) !important;
  transition: opacity 260ms ease, transform 260ms ease !important;
}

.rabino-remove-spinner-overlay::before {
  background: rgba(255, 255, 255, 0.82);
}

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

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

@keyframes rabino-toast-pulse {
  0%,
  100% {
    opacity: 1;
    transform: scale(1);
  }
  50% {
    opacity: 0.35;
    transform: scale(1.7);
  }
}

@media (max-width: 768px) {
  #rabino-toast-container {
    top: max(12px, env(safe-area-inset-top));
    right: max(12px, env(safe-area-inset-right));
    left: max(12px, env(safe-area-inset-left));
    width: auto;
    max-height: calc(100vh - 24px - env(safe-area-inset-top));
    gap: var(--rabino-toast-space-sm);
  }

  .rabino-toast {
    grid-template-columns: 32px minmax(0, 1fr) 40px;
    gap: 10px;
    padding: 12px 12px 12px 14px;
    font-size: 13.5px;
    line-height: 1.6;
    transform: translateY(-18px) scale(0.98);
    transform-origin: top center;
  }

  .rabino-toast.is-visible {
    transform: translateY(0) scale(1);
  }

  .rabino-toast__icon {
    width: 32px;
    height: 32px;
  }

  .rabino-toast__close {
    width: 40px;
    height: 40px;
  }

  .rabino-remove-spinner-ring {
    width: 30px;
    height: 30px;
  }

  .rabino-remove-spinner-ring::after {
    inset: 4px;
  }
}

@media (max-width: 360px) {
  .rabino-toast {
    grid-template-columns: 30px minmax(0, 1fr) 38px;
    gap: 8px;
    padding-inline: 10px;
    font-size: 13px;
  }

  .rabino-toast__icon {
    width: 30px;
    height: 30px;
  }
}

@media (prefers-reduced-motion: reduce) {
  .rabino-toast,
  .rabino-toast__close,
  .rabino-remove-spinner-overlay,
  .rabino-cart-item-removing {
    scroll-behavior: auto !important;
    transition-duration: 0.01ms !important;
  }

  .rabino-remove-spinner-ring::before,
  .rabino-remove-spinner-ring::after,
  .rabino-remove-spinner-dot {
    animation-duration: 1.8s;
  }
}


/* Dashboard-scoped toast theme. Public/site toasts keep their existing appearance. */
.rabino-toast--dashboard-dark {
  --rabino-toast-dashboard-accent: var(--rabino-toast-info);
  color-scheme: dark;
  border-color: var(--rabino-toast-dashboard-border, rgba(148, 163, 184, 0.25));
  background: var(--rabino-toast-dashboard-surface, #111827);
  color: var(--rabino-toast-dashboard-text, #f8fafc);
  box-shadow: 0 18px 44px -22px rgba(0, 0, 0, 0.78),
    0 8px 20px -14px rgba(0, 0, 0, 0.58);
}
.rabino-toast--dashboard-dark.rabino-toast--success {
  --rabino-toast-dashboard-accent: var(--rabino-toast-success);
}
.rabino-toast--dashboard-dark.rabino-toast--error {
  --rabino-toast-dashboard-accent: var(--rabino-toast-error);
}
.rabino-toast--dashboard-dark.rabino-toast--info {
  --rabino-toast-dashboard-accent: var(--rabino-toast-info);
}
.rabino-toast--dashboard-dark .rabino-toast__icon {
  border-color: var(--rabino-toast-dashboard-accent);
  background: rgba(255, 255, 255, 0.06);
  color: var(--rabino-toast-dashboard-accent);
}
.rabino-toast--dashboard-dark .rabino-toast__message {
  color: var(--rabino-toast-dashboard-text, #f8fafc);
}
.rabino-toast--dashboard-dark .rabino-toast__close {
  color: var(--rabino-toast-dashboard-muted, #cbd5e1);
}
.rabino-toast--dashboard-dark .rabino-toast__close:hover,
.rabino-toast--dashboard-dark .rabino-toast__close:focus-visible {
  background: var(--rabino-toast-dashboard-hover, #1e293b);
  color: var(--rabino-toast-dashboard-text, #f8fafc);
}
.rabino-toast--dashboard-dark .rabino-toast__progress {
  background: var(--rabino-toast-dashboard-accent);
}

/* 3.3.1 — one Rabino ToastBox visual contract across dark site/dashboard/checkout contexts. */
.rabino-toast--context-dark{
  --rabino-toast-dashboard-accent:var(--rabino-toast-info);
  color-scheme:dark;
  border-color:var(--rabino-toast-dashboard-border,rgba(148,163,184,.25));
  background:var(--rabino-toast-dashboard-surface,#111827);
  color:var(--rabino-toast-dashboard-text,#f8fafc);
  box-shadow:0 18px 44px -22px rgba(0,0,0,.78),0 8px 20px -14px rgba(0,0,0,.58)
}
.rabino-toast--context-dark.rabino-toast--success{--rabino-toast-dashboard-accent:var(--rabino-toast-success)}
.rabino-toast--context-dark.rabino-toast--error{--rabino-toast-dashboard-accent:var(--rabino-toast-error)}
.rabino-toast--context-dark.rabino-toast--info{--rabino-toast-dashboard-accent:var(--rabino-toast-info)}
.rabino-toast--context-dark .rabino-toast__icon{border-color:var(--rabino-toast-dashboard-accent);background:rgba(255,255,255,.06);color:var(--rabino-toast-dashboard-accent)}
.rabino-toast--context-dark .rabino-toast__message{color:var(--rabino-toast-dashboard-text,#f8fafc)}
.rabino-toast--context-dark .rabino-toast__close{color:var(--rabino-toast-dashboard-muted,#cbd5e1)}
.rabino-toast--context-dark .rabino-toast__close:hover,.rabino-toast--context-dark .rabino-toast__close:focus-visible{background:var(--rabino-toast-dashboard-hover,#1e293b);color:var(--rabino-toast-dashboard-text,#f8fafc)}
.rabino-toast--context-dark .rabino-toast__progress{background:var(--rabino-toast-dashboard-accent)}

/* 3.3.2 — dashboard dark context must win over host-theme toast surfaces. */
#rabino-toast-container .rabino-toast.rabino-toast--dashboard-dark,
#rabino-toast-container .rabino-toast.rabino-toast--context-dark{
  background:var(--rabino-toast-dashboard-surface,#0b1220)!important;
  border-color:var(--rabino-toast-dashboard-border,#334155)!important;
  color:var(--rabino-toast-dashboard-text,#f8fafc)!important;
  color-scheme:dark;
}
#rabino-toast-container .rabino-toast.rabino-toast--dashboard-dark .rabino-toast__message,
#rabino-toast-container .rabino-toast.rabino-toast--context-dark .rabino-toast__message{
  color:var(--rabino-toast-dashboard-text,#f8fafc)!important;
}
