/* ==========================================================================
   Live updates. Loaded after refresh.css, and uses its tokens.
   ========================================================================== */

/* The small status pill in the corner: a pulse while updates are on */

.live-pill {
    position: fixed;
    right: 16px;
    bottom: 16px;
    z-index: 40;
    display: inline-flex;
    align-items: center;
    gap: 8px;
    padding: 6px 12px 6px 10px;
    border: 1px solid var(--line-strong);
    border-radius: 999px;
    background: rgba(26, 29, 34, 0.92);
    -webkit-backdrop-filter: blur(8px);
    backdrop-filter: blur(8px);
    color: var(--color-font2);
    font-family: var(--font-sans);
    font-size: 12.5px;
    font-weight: 500;
    line-height: 1;
    cursor: pointer;
}

.live-pill[hidden] { display: none; }

.live-pill:hover {
    border-color: var(--muted);
    color: var(--color-font1);
}

.live-dot {
    width: 8px;
    height: 8px;
    border-radius: 50%;
    background: var(--ok);
    animation: live-pulse 2.4s ease-out infinite;
}

.live-pill[data-state="paused"] .live-dot { background: var(--muted); animation: none; }
.live-pill[data-state="retry"]  .live-dot { background: var(--warn);  animation: none; }

@keyframes live-pulse {
    0%        { box-shadow: 0 0 0 0 rgba(110, 219, 154, 0.45); }
    70%, 100% { box-shadow: 0 0 0 7px rgba(110, 219, 154, 0); }
}

/* Whatever just changed gets a brief outline that fades away */

.live-flash { animation: live-flash 1.4s ease-out; }

@keyframes live-flash {
    0%   { outline: 2px solid rgba(110, 219, 154, 0.65); outline-offset: -2px; }
    100% { outline: 2px solid rgba(110, 219, 154, 0);    outline-offset: -2px; }
}

@media (prefers-reduced-motion: reduce) {
    .live-dot,
    .live-flash { animation: none; }
}

@media (max-width: 640px) {
    .live-pill { right: 10px; bottom: 10px; }
}
