/* Shared by the homepage and the administrator's live preview. */
.home-scrolling-ad {
    display: flex;
    align-items: center;
    gap: 10px;
    box-sizing: border-box;
    padding: 8px 12px;
    min-width: 0;
    border-top: 1px solid var(--border-color, #e0e0e0);
    background: var(--card-bg, #fff);
    color: var(--text-color, #333);
    font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", "Microsoft YaHei", sans-serif;
}
.home-scrolling-ad[hidden] { display: none !important; }
.home-scrolling-ad--fixed {
    position: fixed;
    left: 0;
    right: 0;
    bottom: var(--home-ad-bottom, 0px);
    z-index: 800;
    box-shadow: 0 -2px 10px rgba(0, 0, 0, .06);
}
.scrolling-ad__label {
    flex: 0 0 auto;
    font-size: 11px;
    line-height: 1.5;
    border: 1px solid currentColor;
    border-radius: 4px;
    padding: 0 4px;
    opacity: .65;
}
.scrolling-ad__viewport { flex: 1 1 auto; min-width: 0; overflow: hidden; }
.scrolling-ad__text {
    display: inline-block;
    width: max-content;
    white-space: pre;
    line-height: 1.6;
    vertical-align: middle;
    animation: home-ad-scroll var(--scroll-duration, 20s) linear infinite;
}
.scrolling-ad__pause {
    flex: 0 0 auto;
    padding: 6px 2px;
    border: 0;
    background: transparent;
    color: inherit;
    cursor: pointer;
    font-size: 12px;
    line-height: 1.4;
}
.scrolling-ad__pause:focus-visible { outline: 2px solid currentColor; outline-offset: 2px; }
.home-scrolling-ad[data-paused="true"] .scrolling-ad__text { animation-play-state: paused; }
body.has-home-scrolling-ad #mobile-page-home::after,
body.has-home-scrolling-ad > .main-content::after {
    content: '';
    display: block;
    height: var(--home-ad-height, 48px);
    flex-shrink: 0;
}
body.inapp .home-scrolling-ad--fixed {
    background: #16213e;
    color: #c8d1e0;
    border-top-color: #2a2a4a;
}
@keyframes home-ad-scroll {
    from { transform: translateX(var(--scroll-start, 100vw)); }
    to { transform: translateX(var(--scroll-end, -100%)); }
}
@media (prefers-reduced-motion: reduce) {
    .scrolling-ad__text { animation: none !important; transform: none; }
    .scrolling-ad__viewport { overflow-x: auto; }
    .scrolling-ad__pause { display: none; }
}
