/* A persistent green accent becomes an indeterminate loader while busy. */
.top-accent-bar {
    position: fixed;
    inset: 0 0 auto;
    height: 4px;
    min-height: 4px;
    flex-shrink: 0;
    overflow: hidden;
    pointer-events: none;
    z-index: 1100;
    background: linear-gradient(135deg, #00853f 0%, #00a94f 50%, #0d8c61 100%);
    box-shadow: 0 2px 8px rgba(0, 133, 63, 0.2);
}

/* Keep the portal bar aligned with the content column beside the sidebar. */
.portal-shell > .portal-reactive-bg {
    padding-top: 4px;
}

.portal-shell .portal-reactive-bg > .top-accent-bar {
    position: fixed;
    inset-inline-start: 240px;
    inset-inline-end: 0;
    z-index: 10;
}

@media (max-width: 767.98px) {
    .portal-shell .portal-reactive-bg > .top-accent-bar {
        inset-inline-start: 0;
    }
}

.top-accent-bar::after {
    content: '';
    position: absolute;
    inset: 0 auto 0 0;
    width: 40%;
    opacity: 0;
    background: linear-gradient(90deg, transparent, rgba(255, 255, 255, 0.85), transparent);
}

[data-page-loading="true"] .top-accent-bar::after {
    opacity: 1;
    animation: taas-page-loading 1.25s ease-in-out infinite;
}

@keyframes taas-page-loading {
    from { transform: translateX(-100%); }
    to { transform: translateX(350%); }
}

@media (prefers-reduced-motion: reduce) {
    [data-page-loading="true"] .top-accent-bar::after {
        width: 100%;
        animation: none;
        background: repeating-linear-gradient(135deg, transparent 0 8px, rgba(255, 255, 255, 0.55) 8px 16px);
    }
}

@media print {
    .top-accent-bar { display: none; }
}
