/* Data-age and connection-loss state for the dashboard.
   See js/modules/dashboard/live-data-freshness.js */

.fw-freshness {
    display: inline-flex;
    align-items: center;
    gap: 7px;
    padding: 5px 10px;
    border: 1px solid var(--border);
    border-radius: 999px;
    background: rgba(var(--ink-rgb), 0.04);
    font-size: var(--font-size-sm);
    color: var(--text-muted);
    white-space: nowrap;
}

.fw-freshness-dot {
    width: 8px;
    height: 8px;
    border-radius: 50%;
    background: var(--text-muted);
}

.fw-freshness[data-status="live"] .fw-freshness-dot {
    background: var(--color-success);
}

.fw-freshness[data-status="disconnected"] {
    border-color: rgba(var(--error-rgb), 0.5);
    background: rgba(var(--error-rgb), 0.12);
    color: var(--color-error-light);
}

.fw-freshness[data-status="disconnected"] .fw-freshness-dot {
    background: var(--color-error);
}

/* A stylesheet display value beats the [hidden] attribute, so the hidden state
   has to be declared here or the banner never goes away. */
.fw-stale-banner[hidden] {
    display: none;
}

.fw-stale-banner {
    display: flex;
    align-items: center;
    gap: 14px;
    flex-wrap: wrap;
    margin-bottom: var(--fw-gap);
    padding: 12px 14px;
    border: 1px solid rgba(var(--error-rgb), 0.5);
    border-left-width: 4px;
    border-radius: var(--radius-lg);
    background: rgba(var(--error-rgb), 0.1);
}

.fw-stale-banner-text {
    flex: 1;
    min-width: 220px;
    margin: 0;
    font-size: var(--font-size-md);
    line-height: 1.45;
    color: var(--text-strong);
}

/* Frozen data is dimmed and desaturated so a glance at a wall screen cannot
   mistake it for a live reading. */
.fw-content.fw-data-frozen {
    opacity: 0.45;
    filter: saturate(0.35);
}

@media (prefers-reduced-transparency: reduce) {
    .fw-content.fw-data-frozen {
        opacity: 0.6;
    }
}
