.zenta-toast-stack {
  position: fixed;
  z-index: 10000;
  top: max(16px, env(safe-area-inset-top));
  right: max(16px, env(safe-area-inset-right));
  display: grid;
  gap: 10px;
  width: min(390px, calc(100vw - 32px));
  pointer-events: none;
}

.zenta-toast {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  gap: 12px;
  padding: 14px 14px 14px 16px;
  color: #eef4ff;
  background: #101927;
  border: 1px solid #29384b;
  border-left: 4px solid #528bff;
  border-radius: 12px;
  box-shadow: 0 12px 36px #0007;
  pointer-events: auto;
  animation: zenta-toast-in 180ms ease-out;
}

.zenta-toast-balance { border-left-color: #31c48d; }
.zenta-toast-trading { border-left-color: #528bff; }
.zenta-toast-messages { border-left-color: #bd8cff; }
.zenta-toast-news { border-left-color: #f0ad4e; }

.zenta-toast-content {
  display: grid;
  gap: 5px;
  min-width: 0;
  font: 14px/1.45 system-ui, sans-serif;
}

.zenta-toast-content strong {
  color: #fff;
  font-size: 14px;
}

.zenta-toast-content span {
  overflow-wrap: anywhere;
  color: #c3cedd;
}

.zenta-toast-link {
  width: fit-content;
  color: #8db4ff;
  font-size: 12px;
  text-decoration: underline;
}

.zenta-toast-close {
  align-self: start;
  width: 30px;
  height: 30px;
  color: #c3cedd;
  background: transparent;
  border: 0;
  border-radius: 7px;
  cursor: pointer;
  font: 22px/1 system-ui, sans-serif;
}

.zenta-toast-close:hover,
.zenta-toast-close:focus-visible {
  color: #fff;
  background: #ffffff17;
}

.zenta-toast-close:focus-visible,
.zenta-toast-link:focus-visible {
  outline: 2px solid #8db4ff;
  outline-offset: 2px;
}

.zenta-notification-detail {
  box-sizing: border-box;
  width: min(520px, calc(100vw - 28px));
  max-width: none;
  max-height: min(78vh, 680px);
  margin: auto;
  padding: 22px;
  overflow: auto;
  border: 1px solid #34445a;
  border-radius: 16px;
  color: #eef4ff;
  background: #101927;
  box-shadow: 0 24px 70px #0009;
}

.zenta-notification-detail::backdrop {
  background: #020712b8;
  backdrop-filter: blur(4px);
}

.zenta-notification-detail-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
}

.zenta-notification-detail-category {
  color: #8db4ff;
  font: 700 11px/1.3 system-ui, sans-serif;
  letter-spacing: .06em;
  text-transform: uppercase;
}

.zenta-notification-detail-close {
  display: grid;
  flex: 0 0 36px;
  width: 36px;
  height: 36px;
  place-items: center;
  border: 1px solid #34445a;
  border-radius: 9px;
  color: #c3cedd;
  background: transparent;
  cursor: pointer;
  font: 24px/1 system-ui, sans-serif;
}

.zenta-notification-detail-close:hover,
.zenta-notification-detail-close:focus-visible {
  color: #fff;
  background: #ffffff17;
}

.zenta-notification-detail h2 {
  margin: 15px 0 8px;
  color: #fff;
  font: 700 19px/1.35 system-ui, sans-serif;
  overflow-wrap: anywhere;
}

.zenta-notification-detail-body {
  margin: 0;
  color: #d3ddeb;
  font: 14px/1.65 system-ui, sans-serif;
  white-space: pre-wrap;
  overflow-wrap: anywhere;
}

.zenta-notification-detail time {
  display: block;
  margin-top: 15px;
  color: #91a1b7;
  font: 12px/1.45 system-ui, sans-serif;
}

.zenta-notification-detail-status {
  margin: 10px 0 0;
  color: #ff9a9a;
  font: 12px/1.45 system-ui, sans-serif;
}

.zenta-notification-detail-status:empty {
  display: none;
}

.zenta-notification-detail-link {
  display: inline-flex;
  min-height: 38px;
  align-items: center;
  justify-content: center;
  margin-top: 17px;
  padding: 0 15px;
  border: 1px solid #2878e8;
  border-radius: 9px;
  color: #fff;
  background: #145dba;
  font: 650 13px/1.2 system-ui, sans-serif;
  text-decoration: none;
}

.zenta-notification-detail-link:hover {
  background: #1d6dce;
}

.zenta-notification-detail :focus-visible {
  outline: 2px solid #8db4ff;
  outline-offset: 3px;
}

html[data-theme="light"] .zenta-notification-detail {
  border-color: #cbd5e1;
  color: #1f2937;
  background: #fff;
  box-shadow: 0 24px 70px #0f172a3d;
}

html[data-theme="light"] .zenta-notification-detail-category {
  color: #174ea6;
}

html[data-theme="light"] .zenta-notification-detail-close {
  border-color: #cbd5e1;
  color: #475569;
}

html[data-theme="light"] .zenta-notification-detail-close:hover,
html[data-theme="light"] .zenta-notification-detail-close:focus-visible {
  color: #1f2937;
  background: #edf2f7;
}

html[data-theme="light"] .zenta-notification-detail h2 {
  color: #1f2937;
}

html[data-theme="light"] .zenta-notification-detail-body {
  color: #344256;
}

html[data-theme="light"] .zenta-notification-detail time {
  color: #64748b;
}

html[data-theme="light"] .zenta-notification-detail-link {
  border-color: #2478ff;
  color: #fff;
  background: #2478ff;
}

html[data-theme="light"] .zenta-notification-detail-link:hover {
  background: #155ee0;
}

.zenta-fee-disclosure { display: none !important; }

@keyframes zenta-toast-in {
  from { opacity: 0; transform: translateY(-8px); }
  to { opacity: 1; transform: translateY(0); }
}

@media (max-width: 600px) {
  .zenta-toast-stack {
    top: max(8px, env(safe-area-inset-top));
    right: max(8px, env(safe-area-inset-right));
    left: max(8px, env(safe-area-inset-left));
    width: auto;
  }

  .zenta-notification-detail {
    padding: 17px;
    border-radius: 14px;
  }

  .zenta-notification-detail h2 {
    font-size: 17px;
  }
}

@media (prefers-reduced-motion: reduce) {
  .zenta-toast { animation: none; }
}
