/* Opt-in shared feedback for results produced by one user action. */
.q-results-loading {
    position: relative;
    min-width: 0;
}

.q-results-heading {
    display: flex;
    align-items: center;
    min-height: var(--q-control-height);
    padding-right: 230px;
    margin-bottom: var(--q-space-3);
}

.q-results-loading .q-loading-indicator {
    position: absolute;
    top: 0;
    right: 0;
    min-height: var(--q-control-height-compact);
    padding: var(--q-space-2) var(--q-space-3);
    box-shadow: none;
    pointer-events: none;
}

/* The shared ring stays visible even before the icon font is available. */
.q-results-loading .q-loading-icon {
    width: 14px;
    height: 14px;
    flex: 0 0 14px;
    border: 2px solid var(--q-primary);
    border-right-color: transparent;
    border-radius: 50%;
    font-size: 0;
}

.q-results-loading .q-loading-icon::before {
    content: none;
}

/* A loading indicator reports status without catching chart/table clicks. */
.q-results-loading > div:has(> .q-loading-indicator) {
    pointer-events: none;
}

/* Follow the shared indicator's delayed lifecycle, not individual callback
   attributes which briefly clear between the calculation and derived grids.
   Keep selection/settings controls consistent with the result surface too. */
.q-results-loading:has(.q-loading-indicator),
.q-results-loading:has(.q-loading-indicator) *,
.q-allocation-page:has(.q-results-loading .q-loading-indicator),
.q-allocation-page:has(.q-results-loading .q-loading-indicator) *,
.q-results-page:has(.q-results-loading .q-loading-indicator),
.q-results-page:has(.q-results-loading .q-loading-indicator) * {
    cursor: progress !important;
}

.q-results-heading > h2 {
    margin: 0;
    font-size: var(--q-font-size-lg);
    color: var(--q-text-strong);
}

@media (max-width: 540px) {
    .q-results-heading {
        align-items: flex-start;
        min-height: calc(var(--q-control-height) + var(--q-control-height-compact) + var(--q-space-1));
        padding-right: 0;
    }

    .q-results-loading .q-loading-indicator {
        top: var(--q-control-height);
        left: 0;
        right: auto;
    }
}

@media (prefers-reduced-motion: reduce) {
    .q-results-loading .q-loading-icon {
        animation: none;
    }
}
