/* ============================================================
   Live alert toast — bottom-left (bottom-right is the BMC widget).
   One toast at a time; the JS never stacks them.
   ============================================================ */

.live-alert {
  --la-accent: #bd5fff;
  position: fixed;
  left: 18px;
  bottom: 18px;
  z-index: 9998;
  width: min(370px, calc(100vw - 36px));
  display: flex;
  gap: 0;
  overflow: hidden;
  border: 1px solid rgba(255, 255, 255, .14);
  border-radius: 14px;
  background: rgba(16, 21, 35, .96);
  box-shadow: 0 24px 60px -18px rgba(0, 0, 0, .85);
  backdrop-filter: blur(10px);
  font-family: 'Inter', ui-sans-serif, system-ui, -apple-system, Segoe UI, Roboto;
  opacity: 0;
  transform: translateY(14px) scale(.98);
  transition: opacity .32s cubic-bezier(.22, .61, .36, 1),
              transform .32s cubic-bezier(.22, .61, .36, 1);
}

.live-alert.is-visible {
  opacity: 1;
  transform: translateY(0) scale(1);
}

.live-alert.is-leaving {
  opacity: 0;
  transform: translateY(10px) scale(.985);
}

/* Severity stripe */
.live-alert__stripe {
  flex: 0 0 3px;
  background: var(--la-accent);
}

.live-alert--critical { --la-accent: #ff4d6d; }
.live-alert--high     { --la-accent: #ff9562; }
.live-alert--medium   { --la-accent: #bd5fff; }
.live-alert--low      { --la-accent: #45c7a1; }

.live-alert__body {
  position: relative;
  flex: 1;
  min-width: 0;
  padding: 13px 15px 12px;
}

.live-alert__head {
  display: flex;
  align-items: center;
  gap: 8px;
  /* Leaves room for the absolutely positioned close button. */
  padding-right: 24px;
  margin-bottom: 7px;
}

.live-alert__dot {
  flex: 0 0 auto;
  width: 6px;
  height: 6px;
  border-radius: 50%;
  background: var(--la-accent);
  animation: laPulse 2s ease-in-out infinite;
}

@keyframes laPulse {
  0%   { box-shadow: 0 0 0 0 color-mix(in srgb, var(--la-accent) 55%, transparent); }
  70%  { box-shadow: 0 0 0 7px transparent; }
  100% { box-shadow: 0 0 0 0 transparent; }
}

.live-alert__eyebrow {
  min-width: 0;
  overflow: hidden;
  color: var(--la-accent);
  font-size: 10px;
  font-weight: 700;
  letter-spacing: .09em;
  text-overflow: ellipsis;
  text-transform: uppercase;
  white-space: nowrap;
}

.live-alert__time {
  margin-left: auto;
  flex: 0 0 auto;
  color: rgba(255, 255, 255, .42);
  font-size: 10.5px;
  white-space: nowrap;
}

.live-alert__title {
  display: -webkit-box;
  overflow: hidden;
  margin: 0;
  color: #fff;
  font-size: 13.5px;
  font-weight: 600;
  line-height: 1.42;
  -webkit-box-orient: vertical;
  -webkit-line-clamp: 2;
}

/* Stretched over the card so the whole toast is the click target. */
.live-alert__link::after {
  content: "";
  position: absolute;
  inset: 0;
  z-index: 1;
}

.live-alert__link {
  color: inherit;
  text-decoration: none;
}

.live-alert__foot {
  display: flex;
  align-items: center;
  gap: 8px;
  margin-top: 9px;
}

.live-alert__source {
  min-width: 0;
  overflow: hidden;
  color: rgba(255, 255, 255, .5);
  font-size: 11px;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.live-alert__cta {
  margin-left: auto;
  flex: 0 0 auto;
  display: inline-flex;
  align-items: center;
  gap: 5px;
  color: rgba(255, 255, 255, .62);
  font-size: 11.5px;
  font-weight: 600;
  transition: color .2s ease;
}

.live-alert__cta svg { transition: transform .2s ease; }

.live-alert:hover .live-alert__cta { color: var(--la-accent); }

.live-alert:hover .live-alert__cta svg { transform: translateX(3px); }

/* Dismiss sits above the stretched link. */
.live-alert__close {
  position: absolute;
  top: 8px;
  right: 8px;
  z-index: 2;
  display: grid;
  place-items: center;
  width: 22px;
  height: 22px;
  padding: 0;
  border: 0;
  border-radius: 6px;
  background: transparent;
  color: rgba(255, 255, 255, .38);
  cursor: pointer;
  line-height: 1;
  transition: background-color .18s ease, color .18s ease;
}

.live-alert__close:hover {
  background: rgba(255, 255, 255, .08);
  color: #fff;
}

/* Auto-dismiss countdown */
.live-alert__timer {
  position: absolute;
  left: 0;
  bottom: 0;
  height: 2px;
  width: 100%;
  transform-origin: left center;
  background: var(--la-accent);
  opacity: .5;
}

.live-alert.is-counting .live-alert__timer {
  animation: laCountdown var(--la-duration, 12s) linear forwards;
}

.live-alert:hover .live-alert__timer {
  animation-play-state: paused;
}

@keyframes laCountdown {
  from { transform: scaleX(1); }
  to   { transform: scaleX(0); }
}

@media (max-width: 560px) {
  .live-alert {
    left: 12px;
    right: 12px;
    bottom: 12px;
    width: auto;
  }
}

@media (prefers-reduced-motion: reduce) {
  .live-alert {
    transition: opacity .2s ease;
    transform: none;
  }

  .live-alert.is-visible,
  .live-alert.is-leaving { transform: none; }

  .live-alert__dot { animation: none; }

  .live-alert.is-counting .live-alert__timer { animation: none; }
}
