.hf-ribbon-alert-center {
    display: none;
}

.hf-top-ribbon.has-civic-alert .hf-ribbon-alert-center {
    display: flex;
    align-items: center;
    justify-content: center;
    flex: 1 1 auto;
    min-width: 0;
    overflow: hidden;
}

/* Keep the ticker in one compact lane; each new reminder rises into view. */
@media (min-width: 769px) {
    .hf-top-ribbon.has-civic-alert .hf-ribbon-alert-center {
        position: static;
        width: auto;
    }

    .hf-top-ribbon.has-civic-alert .hf-civic-alert-link {
        width: min(58vw, 720px);
        max-width: min(58vw, 720px);
        height: 100%;
        text-align: center;
    }
}

.hf-top-ribbon.has-civic-alert .hf-ribbon-left {
    min-width: 0;
    flex: 0 0 auto;
}

.hf-top-ribbon.has-civic-alert .hf-civic-alert-link {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    min-width: 0;
    max-width: min(58vw, 720px);
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
    text-align: center;
    color: #fff;
    text-decoration: none;
    transition: opacity 180ms ease;
}

.hf-top-ribbon.has-civic-alert .hf-civic-alert-link:hover {
    color: #f3f5f5;
    text-decoration: underline;
    text-underline-offset: 3px;
}

.hf-top-ribbon.has-civic-alert .hf-civic-alert-link.is-static {
    cursor: default;
}

.hf-top-ribbon.has-civic-alert .hf-civic-ticker-track {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    white-space: nowrap;
    will-change: transform;
}

.hf-top-ribbon.has-civic-alert .hf-civic-ticker-track.is-scrolling {
    animation: hf-civic-ticker-rise 420ms ease-out both;
}

@keyframes hf-civic-ticker-rise {
    from { transform: translateY(100%); opacity: 0; }
    to { transform: translateY(0); opacity: 1; }
}

.hf-top-ribbon.has-civic-alert .hf-civic-alert-link.is-transitioning {
    opacity: 0.35;
}

.hf-civic-alert-tag:not([hidden]) {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    order: -1;
    flex: 0 0 auto;
    height: 19px;
    box-sizing: border-box;
    line-height: 1;
    margin-right: 8px;
    padding: 0 6px;
    border: 1px solid rgba(242, 211, 143, 0.6);
    border-radius: 3px;
    color: #f2d38f;
    font-size: 11px;
    font-weight: 600;
}

@media (max-width: 768px) {
    /* Mobile keeps the top ribbon for active civic alerts only. */
    .hf-top-ribbon:not(.has-civic-alert) {
        display: none !important;
    }

    .hf-top-ribbon.has-civic-alert {
        height: auto !important;
        min-height: 34px !important;
        line-height: normal !important;
    }

    .hf-top-ribbon.has-civic-alert .hf-ribbon-content {
        display: grid !important;
        grid-template-columns: minmax(0, 1fr);
        height: auto !important;
        min-height: 34px;
        padding: 5px 12px;
        gap: 0;
        box-sizing: border-box;
    }

    .hf-top-ribbon.has-civic-alert .hf-ribbon-left {
        display: none !important;
    }

    .hf-top-ribbon.has-civic-alert .hf-ribbon-alert-center {
        width: 100%;
        min-width: 0;
        min-height: 24px;
        order: 1;
        justify-content: flex-start;
    }

    .hf-top-ribbon.has-civic-alert .hf-civic-alert-link {
        width: 100%;
        max-width: none;
        font-size: 12px;
        text-align: left;
        height: auto;
        justify-content: flex-start;
    }

    .hf-top-ribbon.has-civic-alert .hf-civic-ticker-track {
        display: flex;
        align-items: center;
        width: 100%;
        min-width: 0;
        gap: 6px;
    }

    .hf-top-ribbon.has-civic-alert [data-ticker-message] {
        min-width: 0;
        overflow: hidden;
        text-overflow: ellipsis;
        white-space: nowrap;
    }

    .hf-top-ribbon.has-civic-alert .hf-civic-alert-tag:not([hidden]) {
        order: -1;
        flex: 0 0 auto;
        margin-right: 0;
    }

    .hf-top-ribbon.has-civic-alert .hf-civic-ticker-track.is-scrolling {
        animation-duration: 360ms;
    }

}

@media (prefers-reduced-motion: reduce) {
    .hf-top-ribbon.has-civic-alert .hf-civic-alert-link {
        transition: none;
    }
}
