:root {
  --toast-bg: #ffffff;
  --toast-text: #111111;
  --toast-border: #e2e8f0;
  --toast-shadow: 0 20px 25px -5px rgba(0, 0, 0, 0.05), 0 10px 10px -5px rgba(0, 0, 0, 0.04);
  --toast-transition: 400ms cubic-bezier(0.16, 1, 0.3, 1);
  --toast-offset: 24px;
}

.dbb-toast-trigger {
  text-decoration: underline;
  text-decoration-style: dotted;
  text-underline-offset: 4px;
  cursor: pointer;
}

.dbb-toast-content {
  position: fixed;
  width: max-content;
  max-width: 380px;
  background: var(--toast-bg);
  border: 1px solid var(--toast-border);
  box-shadow: var(--toast-shadow);
  border-radius: 8px;
  padding: 16px;
  z-index: 9999;
  
  /* Initial hidden state */
  opacity: 0;
  visibility: hidden;
  pointer-events: none;
  
  transition: transform var(--toast-transition), 
              opacity var(--toast-transition), 
              visibility var(--toast-transition);
}

/* Active State */
.dbb-toast-content.is-active {
  opacity: 1;
  visibility: visible;
  pointer-events: auto;
}

/* --- Position Mapping & Animation Vectors --- */
.toast-bottom-right { bottom: var(--toast-offset); right: var(--toast-offset); transform: translateY(20px); }
.toast-bottom-right.is-active { transform: translateY(0); }

.toast-bottom-left { bottom: var(--toast-offset); left: var(--toast-offset); transform: translateY(20px); }
.toast-bottom-left.is-active { transform: translateY(0); }

.toast-top-right { top: var(--toast-offset); right: var(--toast-offset); transform: translateY(-20px); }
.toast-top-right.is-active { transform: translateY(0); }

.toast-top-left { top: var(--toast-offset); left: var(--toast-offset); transform: translateY(-20px); }
.toast-top-left.is-active { transform: translateY(0); }

.toast-bottom-center { bottom: var(--toast-offset); left: 50%; transform: translate(-50%, 20px); }
.toast-bottom-center.is-active { transform: translate(-50%, 0); }

.toast-top-center { top: var(--toast-offset); left: 50%; transform: translate(-50%, -20px); }
.toast-top-center.is-active { transform: translate(-50%, 0); }

/* --- Internal Formatting --- */
.dbb-toast-header {
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  margin-bottom: 8px;
}

.dbb-toast-title {
  font-size: 15px;
  font-weight: 700;
  color: var(--toast-text);
  margin: 0;
  padding-right: 16px;
  letter-spacing: -0.01em;
}

.dbb-toast-close {
  background: transparent;
  border: none;
  color: #64748b;
  cursor: pointer;
  padding: 4px;
  display: flex;
  align-items: center;
  justify-content: center;
  border-radius: 4px;
  transition: background 0.2s ease, color 0.2s ease;
  margin-top: -4px;
  margin-right: -4px;
}

.dbb-toast-close:hover {
  background: #f1f5f9;
  color: #111111;
}

.dbb-toast-body p {
  font-size: 14px;
  line-height: 1.5;
  color: #475569;
  margin: 0;
}

.dbb-toast-content[data-ttheme="dark"] {
  /* Override base variables for the dark aesthetic */
  --toast-bg: #0f172a;
  --toast-text: #f8fafc;
  --toast-border: #334155;
  /* Deepen the shadow to match the darker background */
  --toast-shadow: 0 20px 25px -5px rgba(0, 0, 0, 0.05), 0 10px 10px -5px rgba(0, 0, 0, 0.04);
}

/* Secondary Text Contrast */
.dbb-toast-content[data-ttheme="dark"] .dbb-toast-body p {
  color: #94a3b8;
}

/* Dismiss UI Normalization */
.dbb-toast-content[data-ttheme="dark"] .dbb-toast-close {
  color: #94a3b8;
}

.dbb-toast-content[data-ttheme="dark"] .dbb-toast-close:hover {
  background: #1e293b;
  color: #f8fafc;
}

/* --- Mobile Normalization --- */
@media (max-width: 600px) {
  .dbb-toast-content {
    left: 16px !important;
    right: 16px !important;
    width: auto;
    max-width: none;
  }
  .toast-bottom-center, .toast-bottom-right, .toast-bottom-left { transform: translateY(20px) !important; }
  .toast-top-center, .toast-top-right, .toast-top-left { transform: translateY(-20px) !important; }
  .dbb-toast-content.is-active { transform: translateY(0) !important; }
}