/* Ticker bar above /swaps — app/ticker/component.py.
   Quiet by design: thin, muted, constant speed (set inline per content),
   pauses on hover / tap, static for prefers-reduced-motion. */

.sf-ticker {
    display: flex;
    align-items: stretch;
    height: 28px;
    background: #141414;
    border-bottom: 1px solid #2a2a2a;
    color: #b8b8b8;
    font-family: ui-monospace, "SF Mono", Menlo, Consolas, monospace;
    font-size: 12.5px;
    font-variant-numeric: tabular-nums;
    line-height: 28px;
    overflow: hidden;
    white-space: nowrap;
}

.sf-ticker--hidden {
    display: none;
}

.sf-ticker__content {
    display: flex;
    flex: 1 1 auto;
    min-width: 0;
}

.sf-ticker__pinned {
    flex: 0 0 auto;
    display: flex;
    padding: 0 12px;
    background: rgba(220, 53, 69, 0.18);
    border-right: 1px solid rgba(220, 53, 69, 0.45);
    color: #f1f1f1;
}

.sf-ticker__viewport {
    flex: 1 1 auto;
    min-width: 0;
    overflow: hidden;
    outline: none;
    /* Soft edges so text does not cut off hard at the sides. */
    -webkit-mask-image: linear-gradient(90deg, transparent 0, #000 24px, #000 calc(100% - 24px), transparent 100%);
    mask-image: linear-gradient(90deg, transparent 0, #000 24px, #000 calc(100% - 24px), transparent 100%);
}

.sf-ticker__track {
    display: inline-flex;
    will-change: transform;
    animation-name: sf-ticker-scroll;
    animation-timing-function: linear;
    animation-iteration-count: infinite;
}

.sf-ticker:hover .sf-ticker__track,
.sf-ticker__viewport:focus .sf-ticker__track,
.sf-ticker__viewport:focus-within .sf-ticker__track {
    animation-play-state: paused;
}

.sf-ticker__copy {
    display: inline-flex;
    flex: 0 0 auto;
}

.sf-ticker__item {
    display: inline-flex;
    align-items: center;
    padding: 0 24px;
}

.sf-ticker__item--link,
.sf-ticker__item--link:visited {
    color: inherit;
    text-decoration: none;
}

.sf-ticker__item--link::after {
    content: "\2197";
    margin-left: 6px;
    color: #fb8b1e;
    font-size: 11px;
}

.sf-ticker__item--link:hover {
    color: #fff;
    text-decoration: underline;
    text-underline-offset: 3px;
}

.sf-ticker__item--warn {
    color: #e8c07a;
}

.sf-ticker__item--alert {
    color: #f1f1f1;
    font-weight: 600;
    padding: 0 12px 0 0;
}

.sf-ticker__dot {
    width: 6px;
    height: 6px;
    border-radius: 50%;
    margin-right: 8px;
    background: #6c6c6c;
    flex: 0 0 auto;
}

.sf-ticker__dot--info {
    background: #fb8b1e;
}

.sf-ticker__dot--warn {
    background: #f0ad4e;
}

.sf-ticker__dot--alert {
    background: #dc3545;
}

.sf-ticker__close {
    flex: 0 0 auto;
    width: 28px;
    border: 0;
    border-left: 1px solid #2a2a2a;
    background: transparent;
    color: #777;
    padding: 0;
    line-height: 28px;
}

.sf-ticker__close:hover {
    color: #ddd;
}

/* Admin preview: always visible, rounded, no close button. */
.sf-ticker--preview {
    border: 1px solid #2a2a2a;
    border-radius: 6px;
}

.sf-ticker__empty {
    padding: 0 12px;
    color: #777;
}

@keyframes sf-ticker-scroll {
    from { transform: translateX(0); }
    to   { transform: translateX(-50%); }
}

@media (prefers-reduced-motion: reduce) {
    .sf-ticker__track {
        animation: none;
    }
    .sf-ticker__copy[aria-hidden="true"],
    .sf-ticker__item--repeat {
        display: none;
    }
    .sf-ticker__viewport {
        overflow-x: auto;
        -webkit-mask-image: none;
        mask-image: none;
    }
}

@media (max-width: 576px) {
    .sf-ticker {
        font-size: 12px;
    }
    .sf-ticker__item {
        padding: 0 18px;
    }
}
