/**
 * Super Speedy Welcome - event notification toasts.
 *
 * Position comes from custom properties the script measures at runtime:
 *   --ssw-ev-bottom  distance from the bottom, above the minimised bar if shown
 *   --ssw-ev-edge    distance from the side edge
 *   --ssw-ev-width   width, narrowed to stay clear of the chat bubble
 * The defaults below apply only until the first measurement.
 */

.ssw-events {
    position: fixed;
    z-index: 999990; /* under the popover overlay (999998) and the chat (999999) */
    bottom: var(--ssw-ev-bottom, 16px);
    left: var(--ssw-ev-edge, 16px);
    width: var(--ssw-ev-width, 360px);
    max-width: calc(100vw - 24px);
    display: flex;
    flex-direction: column;
    gap: 8px;
    pointer-events: none;
    transition: bottom 0.25s ease;
}

.ssw-events--bottom-right {
    left: auto;
    right: var(--ssw-ev-edge, 16px);
}

.ssw-events .ssw-event {
    pointer-events: auto;
    box-sizing: border-box;
    display: flex;
    align-items: flex-start;
    gap: 12px;
    width: 100%;
    margin: 0;
    padding: 12px 6px 12px 14px;
    background: #101010;
    color: #f1f1f1;
    border-left: 3px solid #9933cc;
    border-radius: 8px;
    box-shadow: 0 8px 24px rgba(0, 0, 0, 0.3);
    font-family: "Segoe UI", Roboto, -apple-system, BlinkMacSystemFont, Oxygen-Sans, Ubuntu, Cantarell, "Helvetica Neue", sans-serif;
    font-size: 14px;
    line-height: 1.45;
    text-align: left;
    opacity: 0;
    transform: translateY(12px);
    transition: opacity 0.25s ease, transform 0.25s ease;
}

.ssw-events .ssw-event.is-visible {
    opacity: 1;
    transform: none;
}

/* Would cover something it must not (the hero's Copy button, the open
   popover or chat): hidden until that is clear, timer paused. */
.ssw-events .ssw-event.is-yielding {
    visibility: hidden;
    pointer-events: none;
}

.ssw-events .ssw-event__icon {
    flex: 0 0 40px;
    width: 40px;
    height: 40px;
    margin: 2px 0 0;
    border-radius: 6px;
    object-fit: cover;
}

.ssw-events .ssw-event__body {
    flex: 1 1 auto;
    min-width: 0;
}

.ssw-events .ssw-event__title,
.ssw-events .ssw-event__message,
.ssw-events .ssw-event__meta {
    margin: 0;
    padding: 0;
    color: inherit;
    font-size: 14px;
    line-height: 1.45;
    overflow-wrap: anywhere;
}

.ssw-events .ssw-event__title {
    font-weight: 700;
    color: #fff;
}

.ssw-events .ssw-event__meta {
    display: flex;
    flex-wrap: wrap;
    align-items: baseline;
    gap: 2px 12px;
    margin-top: 4px;
    font-size: 13px;
}

.ssw-events .ssw-event__time {
    color: #b3b3b3;
}

.ssw-events .ssw-event__link,
.ssw-events .ssw-event__link:visited {
    color: #d9a6f2;
    font-weight: 600;
    text-decoration: underline;
    text-underline-offset: 2px;
}

.ssw-events .ssw-event__link:hover {
    color: #fff;
}

.ssw-events .ssw-event__close {
    appearance: none;
    flex: 0 0 36px;
    width: 36px;
    height: 36px;
    margin: -8px 0 0;
    padding: 0;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    background: transparent;
    border: 0;
    border-radius: 4px;
    box-shadow: none;
    color: #b3b3b3;
    font-size: 22px;
    line-height: 1;
    text-transform: none;
    cursor: pointer;
}

.ssw-events .ssw-event__close:hover {
    color: #fff;
    background: transparent;
}

.ssw-events .ssw-event__link:focus-visible,
.ssw-events .ssw-event__close:focus-visible {
    outline: 2px solid #d9a6f2;
    outline-offset: 2px;
}

@media (prefers-reduced-motion: reduce) {
    .ssw-events,
    .ssw-events .ssw-event {
        transition: none;
    }

    .ssw-events .ssw-event {
        transform: none;
    }
}
