.twai-notify-stack {
  position: fixed;
  top: max(10px, env(safe-area-inset-top));
  right: max(14px, env(safe-area-inset-right));
  bottom: auto;
  z-index: 2147483647;
  display: grid;
  gap: 10px;
  width: min(360px, calc(100vw - 28px));
  pointer-events: none;
}

.twai-notify-item {
  display: grid;
  grid-template-columns: auto 1fr;
  align-items: center;
  gap: 10px;
  min-height: 52px;
  padding: 12px 12px 12px 14px;
  border-radius: 18px;
  color: #0f172a;
  background: rgba(255, 255, 255, .96);
  border: 1px solid rgba(15, 23, 42, .12);
  box-shadow: 0 18px 45px rgba(15, 23, 42, .18);
  transform: translateY(-12px);
  opacity: 0;
  transition: opacity .18s ease, transform .18s ease;
  pointer-events: auto;
  overflow: hidden;
  cursor: pointer;
  user-select: none;
  -webkit-tap-highlight-color: transparent;
}

.twai-notify-item:focus-visible {
  outline: 3px solid rgba(37, 99, 235, .34);
  outline-offset: 2px;
}

.twai-notify-item.show {
  opacity: 1;
  transform: translateY(0);
}

.twai-notify-dot {
  width: 10px;
  height: 10px;
  border-radius: 999px;
  background: linear-gradient(135deg, #2563eb, #06b6d4);
  box-shadow: 0 0 0 6px rgba(37, 99, 235, .10);
}

.twai-notify-item.success .twai-notify-dot { background: linear-gradient(135deg, #16a34a, #22c55e); box-shadow: 0 0 0 6px rgba(34, 197, 94, .12); }
.twai-notify-item.error .twai-notify-dot { background: linear-gradient(135deg, #dc2626, #f97316); box-shadow: 0 0 0 6px rgba(239, 68, 68, .12); }
.twai-notify-item.warning .twai-notify-dot { background: linear-gradient(135deg, #d97706, #facc15); box-shadow: 0 0 0 6px rgba(250, 204, 21, .14); }

.twai-notify-message {
  font-size: 14px;
  line-height: 1.45;
  font-weight: 800;
  word-break: break-word;
}

.twai-notify-close,
.twai-notify-x {
  border: 0;
  background: transparent;
  color: #475569;
  cursor: pointer;
  font: inherit;
  font-size: 22px;
  line-height: 1;
}

.twai-notify-close {
  width: 30px;
  height: 30px;
  border-radius: 999px;
}

.twai-notify-close:hover,
.twai-notify-x:hover {
  background: rgba(15, 23, 42, .06);
  color: #0f172a;
}

.twai-notify-dialog {
  position: fixed;
  inset: 0;
  z-index: 2147483646;
  display: none;
  place-items: center;
  padding: 18px;
  background: transparent;
}

.twai-notify-dialog.open {
  display: grid;
}

.twai-notify-card {
  position: relative;
  width: min(420px, calc(100vw - 28px));
  border-radius: 24px;
  padding: 22px;
  background: rgba(255, 255, 255, .98);
  color: #0f172a;
  border: 1px solid rgba(15, 23, 42, .12);
  box-shadow: 0 24px 70px rgba(15, 23, 42, .22);
}

.twai-notify-title {
  margin-right: 34px;
  font-size: 20px;
  font-weight: 950;
  letter-spacing: -.02em;
}

.twai-notify-text {
  margin-top: 10px;
  color: #475569;
  font-size: 14px;
  line-height: 1.55;
  font-weight: 700;
  white-space: pre-line;
}

.twai-notify-x {
  position: absolute;
  top: 14px;
  right: 14px;
  width: 36px;
  height: 36px;
  border-radius: 999px;
  border: 1px solid rgba(15, 23, 42, .10);
  background: #fff;
}

.twai-notify-input {
  width: 100%;
  min-height: 44px;
  margin-top: 14px;
  border: 1px solid rgba(15, 23, 42, .14);
  border-radius: 14px;
  padding: 11px 13px;
  color: #0f172a;
  background: rgba(248, 250, 252, .95);
  outline: none;
  font: inherit;
  font-weight: 700;
}

.twai-notify-input:focus {
  border-color: rgba(37, 99, 235, .55);
  box-shadow: 0 0 0 4px rgba(37, 99, 235, .10);
}

.twai-notify-actions {
  display: flex;
  justify-content: flex-end;
  gap: 10px;
  margin-top: 18px;
}

.twai-notify-btn {
  min-height: 42px;
  border-radius: 999px;
  border: 1px solid rgba(15, 23, 42, .12);
  padding: 0 16px;
  font: inherit;
  font-weight: 900;
  cursor: pointer;
}

.twai-notify-btn.primary {
  color: #fff;
  background: linear-gradient(135deg, #2563eb, #06b6d4);
  border-color: transparent;
  box-shadow: 0 12px 28px rgba(37, 99, 235, .22);
}

.twai-notify-btn.soft {
  color: #0f172a;
  background: rgba(241, 245, 249, .95);
}

.twai-notify-btn:hover {
  transform: translateY(-1px);
}

@media (max-width: 640px) {
  .twai-notify-stack {
    top: max(8px, env(safe-area-inset-top));
    right: max(8px, env(safe-area-inset-right));
    bottom: auto;
    width: calc(100vw - 16px);
  }

  .twai-notify-actions {
    flex-direction: column-reverse;
  }

  .twai-notify-btn {
    width: 100%;
  }
}


body > .notification,
body > .messaging-toast,
body > .plan-toast,
body > .profile-toast,
body > #tourToast,
body > .toast {
  top: max(10px, env(safe-area-inset-top)) !important;
  right: max(14px, env(safe-area-inset-right)) !important;
  bottom: auto !important;
  left: auto !important;
  z-index: 2147483647 !important;
}

@media (max-width: 640px) {
  body > .notification,
  body > .messaging-toast,
  body > .plan-toast,
  body > .profile-toast,
  body > #tourToast,
  body > .toast {
    top: max(8px, env(safe-area-inset-top)) !important;
    right: 8px !important;
    left: 8px !important;
    width: auto !important;
    max-width: none !important;
  }
}
