.app-alerts {
  position: fixed;
  top: 90px;
  right: 1rem;
  z-index: 1100;
  display: grid;
  gap: 0.65rem;
  width: min(430px, calc(100% - 2rem));
  max-height: calc(100dvh - 110px);
  overflow-y: auto;
  pointer-events: none;
}

.app-notice.alert {
  margin: 0;
  padding: 1rem 3.5rem 1rem 3.25rem;
  border: 1px solid var(--notice-border, #3dc2934d);
  border-radius: 12px;
  background: var(--notice-bg, linear-gradient(115deg, #193b37, #182d33));
  color: var(--notice-text, #d0f3e5);
  box-shadow: 0 10px 30px #0004;
  font-size: 0.92rem;
  line-height: 1.6;
  overflow-wrap: anywhere;
  pointer-events: auto;
}

.app-notice.alert::before {
  content: var(--notice-icon, "✓");
  position: absolute;
  top: 1rem;
  left: 1rem;
  display: grid;
  width: 25px;
  height: 25px;
  place-items: center;
  border: 1px solid currentColor;
  border-radius: 50%;
  color: inherit;
  font-size: 0.85rem;
  font-weight: 700;
  line-height: 1;
}

.app-notice.alert-danger { --notice-bg: #38232e; --notice-border: #ff3a6f55; --notice-text: #ffd2dc; --notice-icon: "!"; }
.app-notice.alert-warning { --notice-bg: #352f24; --notice-border: #f3955566; --notice-text: #ffe0af; --notice-icon: "!"; }
.app-notice.alert-info { --notice-bg: #1a3046; --notice-border: #42a9e155; --notice-text: #caeafb; --notice-icon: "i"; }

.app-notice.alert .btn-close {
  top: 0.55rem;
  right: 0.55rem;
  padding: 0.85rem;
  border-radius: 8px;
  filter: invert(1) grayscale(100%) brightness(200%);
  opacity: 0.75;
}
.app-notice.alert .btn-close:hover { opacity: 1; }
.app-notice.alert .btn-close:focus-visible { outline: 2px solid currentColor; outline-offset: 2px; }
@media (max-width: 575.98px) { .app-alerts { top: 78px; } }

/* Shared transparent treatment for inline alerts and floating notices. */
body .alert {
  --alert-rgb: 148, 163, 184;
  --alert-text: #dce6f3;
  --bs-alert-color: var(--alert-text);
  --bs-alert-bg: rgba(var(--alert-rgb), .09);
  --bs-alert-border-color: rgba(var(--alert-rgb), .3);
  --bs-alert-link-color: var(--alert-text);
  background: rgba(var(--alert-rgb), .09) !important;
  border-color: rgba(var(--alert-rgb), .3) !important;
  color: var(--alert-text) !important;
  box-shadow: none;
}
body .alert-success { --alert-rgb: 94, 224, 184; --alert-text: #b5f5e2; }
body .alert-warning { --alert-rgb: 237, 182, 76; --alert-text: #f5d99b; }
body .alert-danger, body .alert-error { --alert-rgb: 255, 92, 124; --alert-text: #ffc0ce; }
body .alert-info, body .alert-primary { --alert-rgb: 66, 169, 225; --alert-text: #a8e3ff; }
body .alert-secondary, body .alert-light, body .alert-dark { --alert-rgb: 148, 163, 184; --alert-text: #dce6f3; }
body .alert .alert-link { color: inherit; }
body .alert .btn-close {
  filter: invert(1) grayscale(100%) brightness(200%);
  opacity: .7;
}
body .alert .btn-close:hover { opacity: 1; }
