/*VISIT TOAST: paste this whole file just before </body> on every page where the toast should appear.*/
/*Change the message, timing and how often it shows in the SETTINGS block of the script.*/

.stt-tray {
    position: fixed;
    right: 1.25rem;
    bottom: 1.25rem;
    z-index: 2000;
    width: min(360px, calc(100vw - 2.5rem));
    pointer-events: none;
}
.stt {
    --stt-navy: #0f2d63;
    --stt-ink: #0b1b36;
    --stt-text: #43506a;
    --stt-red: #d6322d;
    --stt-time: 4.2s;
    position: relative;
    overflow: hidden;
    pointer-events: auto;
    display: grid;
    grid-template-columns: auto 1fr auto;
    gap: 0.8rem;
    align-items: center;
    padding: 0.8rem 0.8rem 1rem;
    background: #fff;
    border: 1px solid #dfe4ec;
    border-radius: 14px;
    box-shadow: 0 20px 40px -20px rgba(11, 27, 54, 0.5),
        0 2px 6px rgba(11, 27, 54, 0.06);
    animation: stt-in 0.45s cubic-bezier(0.2, 0.8, 0.2, 1) both;
}
.stt * {
    box-sizing: border-box;
}
.stt.is-leaving {
    animation: stt-out 0.3s ease forwards;
}
@keyframes stt-in {
    from {
        opacity: 0;
        transform: translateY(20px) scale(0.97);
    }
}
@keyframes stt-out {
    to {
        opacity: 0;
        transform: translateY(10px) scale(0.98);
    }
}

.stt-badge {
    display: grid;
    place-items: center;
    width: 2.4rem;
    height: 2.4rem;
    color: #fff;
    background: var(--stt-navy);
    border-radius: 11px;
}
.stt-badge svg {
    width: 1.35rem;
    height: 1.35rem;
}
.stt-title {
    margin: 0;
    font-size: 0.92rem;
    font-weight: 700;
    line-height: 1.3;
    color: var(--stt-ink);
}
.stt-text {
    margin: 0.15rem 0 0;
    font-size: 0.85rem;
    line-height: 1.4;
    color: var(--stt-text);
}
.stt-act,
.stt-act:hover,
.stt-act:focus {
    text-decoration: none;
}
.stt-act {
    display: inline-flex;
    align-items: center;
    gap: 0.4rem;
    margin-top: 0.4rem;
    font-size: 0.85rem;
    font-weight: 600;
    color: var(--stt-navy);
}
.stt-act::after {
    content: "";
    width: 0.42em;
    height: 0.42em;
    border-top: 2px solid currentColor;
    border-right: 2px solid currentColor;
    transform: rotate(45deg);
    transition: transform 0.2s;
}
.stt-act:hover::after {
    transform: translateX(3px) rotate(45deg);
}
.stt-close {
    display: grid;
    place-items: center;
    align-self: start;
    width: 1.9rem;
    height: 1.9rem;
    margin: -0.25rem -0.25rem 0 0;
    padding: 0;
    color: #6b7890;
    background: transparent;
    border: 0;
    border-radius: 50%;
    cursor: pointer;
    transition: background-color 0.2s, color 0.2s;
}
.stt-close:hover {
    color: var(--stt-ink);
    background: #eef1f6;
}
.stt-close svg {
    width: 0.95rem;
    height: 0.95rem;
    fill: none;
    stroke: currentColor;
    stroke-width: 2.2;
    stroke-linecap: round;
}
.stt-act:focus-visible,
.stt-close:focus-visible {
    outline: 3px solid var(--stt-navy);
    outline-offset: 2px;
}

/* countdown line = the timer that closes the toast; it pauses on hover/focus */
.stt-bar {
    position: absolute;
    left: 0;
    bottom: 0;
    width: 100%;
    height: 3px;
    background: var(--stt-red);
    transform-origin: left;
    animation: stt-bar var(--stt-time) linear forwards;
}
.stt:hover .stt-bar,
.stt:focus-within .stt-bar {
    animation-play-state: paused;
}
@keyframes stt-bar {
    to {
        transform: scaleX(0);
    }
}

@media (max-width: 560px) {
    .stt-tray {
        left: 0.75rem;
        right: 0.75rem;
        bottom: calc(0.75rem + env(safe-area-inset-bottom, 0px));
        width: auto;
    }
}
@media (prefers-reduced-motion: reduce) {
    .stt {
        animation: none;
    }
    .stt.is-leaving {
        opacity: 0;
        transition: opacity 0.2s;
    }
}
