.trim-loading-overlay {
    position: fixed;
    inset: 0;
    z-index: 2000;
    display: grid;
    place-items: center;
    padding: 24px;
    background: rgba(10, 15, 40, 0.18);
    opacity: 0;
    visibility: hidden;
    transition: opacity 160ms ease, visibility 160ms ease;
    pointer-events: none;
}

.trim-loading-overlay.is-visible {
    opacity: 1;
    visibility: visible;
}

.trim-loading-message {
    display: inline-flex;
    align-items: center;
    gap: 12px;
    padding: 14px 18px;
    border: 1px solid rgba(10, 15, 40, 0.08);
    border-radius: 14px;
    background: #fff;
    color: #0a0f28;
    box-shadow: 0 12px 36px rgba(10, 15, 40, 0.16);
    font: 600 14px/1.3 system-ui, sans-serif;
}

.trim-loading-spinner,
button.is-trim-loading::after {
    width: 19px;
    height: 19px;
    flex: 0 0 auto;
    border: 2px solid rgba(83, 183, 232, 0.28);
    border-top-color: #2389bb;
    border-radius: 50%;
    animation: trim-loader-spin 700ms linear infinite;
}

button.is-trim-loading {
    position: relative;
    padding-right: 42px;
}

button.is-trim-loading::after {
    position: absolute;
    top: 50%;
    right: 13px;
    width: 16px;
    height: 16px;
    margin-top: -9px;
    content: "";
}

@keyframes trim-loader-spin {
    to { transform: rotate(360deg); }
}

@media (prefers-reduced-motion: reduce) {
    .trim-loading-overlay { transition: none; }
    .trim-loading-spinner,
    button.is-trim-loading::after { animation-duration: 1.4s; }
}
