.publication-flash-wrapper {
  position: fixed;
  top: 108px;
  left: 50%;
  transform: translateX(-50%);
  width: min(960px, calc(100% - 32px));
  z-index: 2000;
  pointer-events: none;
}

.publication-flash-message {
  pointer-events: auto;
  position: relative;
  overflow: hidden;
  margin: 0 0 10px;
  border-radius: 22px;
  border: 1px solid var(--border);
  background:
    linear-gradient(180deg, rgba(255, 255, 255, 0.94), rgba(245, 249, 255, 0.9)),
    var(--card-strong);
  box-shadow: var(--shadow-soft);
  color: var(--text);
}

.publication-flash-message::before {
  content: "";
  position: absolute;
  inset: 0 auto 0 0;
  width: 4px;
  background: rgba(37, 99, 235, 0.24);
}

.publication-flash-message::after {
  content: "";
  position: absolute;
  inset: 0 auto auto 0;
  width: 100%;
  height: 1px;
  background: linear-gradient(90deg, rgba(37, 99, 235, 0.3), rgba(25, 183, 223, 0.18), transparent 70%);
}

.publication-flash-message .flash-inner {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
}

.publication-flash-message .flash-text {
  font-weight: 600;
  color: inherit;
  line-height: 1.45;
}

.publication-flash-message .btn-close {
  flex: 0 0 auto;
  opacity: 0.72;
  filter: none;
}

.publication-flash-message .btn-close:hover {
  opacity: 1;
}

.publication-flash-message.alert-success {
  background:
    radial-gradient(circle at top right, rgba(22, 163, 74, 0.14), transparent 34%),
    linear-gradient(180deg, rgba(244, 253, 246, 0.98), rgba(235, 248, 238, 0.96));
  border-color: rgba(22, 163, 74, 0.18);
  color: #166534;
}

.publication-flash-message.alert-success::before {
  background: linear-gradient(180deg, #22c55e, #16a34a);
}

.publication-flash-message.alert-info {
  background:
    radial-gradient(circle at top right, rgba(37, 99, 235, 0.14), transparent 34%),
    linear-gradient(180deg, rgba(239, 246, 255, 0.98), rgba(232, 241, 255, 0.96));
  border-color: rgba(37, 99, 235, 0.2);
  color: #1d4ed8;
}

.publication-flash-message.alert-info::before {
  background: linear-gradient(180deg, #3b82f6, #2563eb);
}

.publication-flash-message.alert-warning {
  background:
    radial-gradient(circle at top right, rgba(217, 119, 6, 0.14), transparent 34%),
    linear-gradient(180deg, rgba(255, 251, 235, 0.98), rgba(253, 246, 227, 0.96));
  border-color: rgba(217, 119, 6, 0.2);
  color: #a16207;
}

.publication-flash-message.alert-warning::before {
  background: linear-gradient(180deg, #f59e0b, #d97706);
}

.publication-flash-message.alert-danger,
.publication-flash-message.alert-error {
  background:
    radial-gradient(circle at top right, rgba(225, 29, 72, 0.14), transparent 34%),
    linear-gradient(180deg, rgba(255, 241, 242, 0.98), rgba(255, 235, 239, 0.96));
  border-color: rgba(225, 29, 72, 0.22);
  color: #be123c;
}

.publication-flash-message.alert-danger::before,
.publication-flash-message.alert-error::before {
  background: linear-gradient(180deg, #fb7185, #e11d48);
}

.publication-flash-message.alert-secondary {
  color: var(--text);
}

html[data-bs-theme="dark"] .publication-flash-message {
  background:
    linear-gradient(180deg, rgba(18, 24, 21, 0.98), rgba(12, 17, 14, 0.96)),
    var(--card-strong);
  box-shadow: var(--shadow-soft);
}

html[data-bs-theme="dark"] .publication-flash-message .btn-close {
  filter: invert(1) grayscale(1);
}

html[data-bs-theme="dark"] .publication-flash-message.alert-success {
  background:
    radial-gradient(circle at top right, rgba(34, 197, 94, 0.2), transparent 34%),
    linear-gradient(180deg, rgba(17, 34, 20, 0.98), rgba(12, 24, 15, 0.96));
  color: #bbf7d0;
}

html[data-bs-theme="dark"] .publication-flash-message.alert-info {
  background:
    radial-gradient(circle at top right, rgba(77, 134, 255, 0.22), transparent 34%),
    linear-gradient(180deg, rgba(15, 25, 42, 0.98), rgba(11, 18, 31, 0.96));
  color: #dbeafe;
}

html[data-bs-theme="dark"] .publication-flash-message.alert-warning {
  background:
    radial-gradient(circle at top right, rgba(245, 158, 11, 0.2), transparent 34%),
    linear-gradient(180deg, rgba(39, 28, 14, 0.98), rgba(29, 21, 10, 0.96));
  color: #fde68a;
}

html[data-bs-theme="dark"] .publication-flash-message.alert-danger,
html[data-bs-theme="dark"] .publication-flash-message.alert-error {
  background:
    radial-gradient(circle at top right, rgba(251, 113, 133, 0.2), transparent 34%),
    linear-gradient(180deg, rgba(42, 16, 23, 0.98), rgba(31, 12, 18, 0.96));
  color: #fecdd3;
}

@media (max-width: 575.98px) {
  .publication-flash-wrapper {
    top: 92px;
    width: calc(100% - 20px);
  }

  .publication-flash-message {
    border-radius: 18px;
  }
}
