/* LIVE-ONLY. The visual difference between this box and the paper box.
 *
 * Its own file, linked from base.html and login.html, so the divergence from upstream
 * smabot in those shared templates is three lines rather than a block of CSS that every
 * future merge has to reconcile.
 *
 * WHY THIS EXISTS. The paper box and this one serve a pixel-identical dashboard. The
 * operator has both open, in tabs, next to each other. Every safety guard in this
 * repository stops the SOFTWARE from confusing the two; none of them stop a person
 * reading a chart on one screen and pressing a button on the other. This is the guard
 * for that, and it is the only one that is allowed to be loud.
 *
 * Deliberately not subtle, and deliberately not dismissible: a banner you can close is
 * a banner that is closed on the day it mattered. It is also readable in BOTH themes,
 * because the dashboard has a light mode and a warning that vanishes in one of them is
 * worse than no warning — it trains you to stop looking.
 */

:root {
    --live-red: #c62828;
    --live-red-bright: #ff5252;
    --live-amber: #e65100;
}

/* The bar itself. Fixed, full width, above everything including modals. */
.live-banner {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    z-index: 2000;              /* Bootstrap modals sit at 1055; this stays on top. */
    height: 26px;
    line-height: 26px;
    background: var(--live-red);
    color: #fff;
    font-size: 0.78rem;
    font-weight: 700;
    letter-spacing: 0.12em;
    text-transform: uppercase;
    text-align: center;
    font-family: system-ui, -apple-system, "Segoe UI", sans-serif;
    box-shadow: 0 1px 6px rgba(0, 0, 0, 0.45);
    user-select: none;
    pointer-events: none;       /* never swallows a click meant for the page */
}

/* The page has to move down by exactly the banner height, or the bar covers the top of
 * the sidebar and the first row of whatever is on screen. */
body.has-live-banner {
    padding-top: 26px;
}

/* A red hairline around the viewport, so the warning survives scrolling even if the
 * bar is ever off-screen on a small window. */
body.has-live-banner::after {
    content: "";
    position: fixed;
    inset: 0;
    border: 2px solid var(--live-red);
    border-top: none;
    pointer-events: none;
    z-index: 1999;
}

/* The pulsing dot. Motion is what makes it register in peripheral vision when you are
 * looking at a chart rather than at the top of the screen. */
.live-banner .live-dot {
    display: inline-block;
    width: 8px;
    height: 8px;
    margin-right: 0.5rem;
    border-radius: 50%;
    background: #fff;
    vertical-align: middle;
    animation: live-pulse 2s ease-in-out infinite;
}

@keyframes live-pulse {
    0%, 100% { opacity: 1; }
    50%      { opacity: 0.25; }
}

/* Respect a user who has asked the OS for no motion. The dot stays, it just stops
 * blinking — the warning must never depend on the animation to be legible. */
@media (prefers-reduced-motion: reduce) {
    .live-banner .live-dot { animation: none; }
}

/* NOT FIT TO TRADE. A different colour from the ordinary live bar, because this is a
 * different statement: the box is live AND misconfigured. Amber rather than a second
 * red, so the two are distinguishable at a glance and not merely by reading them. */
.live-banner.live-banner-refusing {
    background: var(--live-amber);
    height: auto;
    min-height: 26px;
    line-height: 1.5;
    padding: 4px 10px;
    letter-spacing: 0.04em;
    text-transform: none;
    white-space: normal;
}

body.has-live-banner-refusing::after { border-color: var(--live-amber); }

/* The login page centres a card in the viewport; the banner must not overlap it. */
body.live-login { padding-top: 26px; }
