/* Scope palette tokens to the mask so embedded pages keep their own theme. */
.stats-mask-pending {
    --cps-mask-background: oklch(1 0 0);
    --cps-mask-border: oklch(0.92 0.004 286.32);
    --cps-mask-primary: oklch(0.21 0.006 285.885);
    --cps-mask-muted-foreground: oklch(0.552 0.016 285.938);
    background: var(--cps-mask-background) !important;
    color-scheme: light;
}
.stats-mask-pending body { visibility: hidden !important; }
.stats-mask-pending::before {
    content: "";
    position: fixed;
    z-index: 2147483647;
    top: calc(50% - 24px);
    left: calc(50% - 12px);
    width: 24px;
    height: 24px;
    box-sizing: border-box;
    border: 2px solid var(--cps-mask-border);
    border-top-color: var(--cps-mask-primary);
    border-radius: 50%;
    opacity: 0;
    animation: stats-spin .8s linear infinite, stats-fade .2s .15s forwards;
}
.stats-mask-pending::after {
    content: "\52a0\8f7d\4e2d\2026";
    position: fixed;
    z-index: 2147483647;
    top: calc(50% + 12px);
    left: 0;
    width: 100%;
    text-align: center;
    color: var(--cps-mask-muted-foreground);
    font: 14px/20px ui-sans-serif, system-ui, sans-serif;
    opacity: 0;
    animation: stats-fade .3s .3s forwards;
}
@keyframes stats-spin { to { transform: rotate(360deg); } }
@keyframes stats-fade { to { opacity: 1; } }
