/* Opt-in action feedback. Business state and errors stay with their owning view. */
.ps-feedback-ready [data-action-notice] {
    display: none;
}

.ps-action-notice {
    --notice-surface: var(--color-ps-surface, #18181c);
    --notice-ink: var(--color-ps-dark, #f4f4f5);
    --notice-border: var(--color-ps-border, #42424a);
    position: fixed;
    inset: auto 20px 20px auto;
    margin: 0;
    box-sizing: border-box;
    width: max-content;
    max-width: min(420px, calc(100vw - 32px));
    padding: 12px 8px 12px 16px;
    display: flex;
    align-items: center;
    gap: 12px;
    background: var(--notice-surface);
    color: var(--notice-ink);
    border: 1px solid var(--notice-border);
    border-radius: 0;
    font:
        400 14px/1.5 Inter,
        sans-serif;
    overflow-wrap: anywhere;
    z-index: 10000;
}

.ps-action-notice[hidden] {
    display: none;
}

.ps-action-notice button {
    flex: none;
    width: 44px;
    height: 44px;
    padding: 0;
    background: transparent;
    color: inherit;
    border: 0;
    border-radius: 0;
    font:
        400 24px/1 Inter,
        sans-serif;
    cursor: pointer;
}

.ps-action-notice button:focus-visible {
    outline: 2px solid currentColor;
    outline-offset: -4px;
}

.ps-action-busy {
    position: relative;
    color: transparent !important;
}

.ps-action-busy > * {
    opacity: 0;
}

.ps-action-busy::after {
    content: '';
    position: absolute;
    inset: 50% auto auto 50%;
    width: 16px;
    height: 16px;
    margin: -8px 0 0 -8px;
    background-color: var(--ps-action-ink, var(--color-ps-primary, #a78bfa));
    mask: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24'%3E%3Cpath d='M12 3a9 9 0 1 1-9 9' fill='none' stroke='black' stroke-width='3'/%3E%3C/svg%3E")
        center / contain no-repeat;
}

@media (prefers-reduced-motion: no-preference) {
    .ps-action-busy::after {
        animation: ps-action-spin 750ms linear infinite;
    }
}

@keyframes ps-action-spin {
    to {
        transform: rotate(360deg);
    }
}

:root[data-theme='light'] .ps-action-notice {
    --notice-surface: var(--color-ps-surface, #fff);
    --notice-ink: var(--color-ps-dark, #17171c);
    --notice-border: var(--color-ps-border, #c8c8d0);
}

@media (prefers-color-scheme: light) {
    :root[data-theme='auto'] .ps-action-notice {
        --notice-surface: var(--color-ps-surface, #fff);
        --notice-ink: var(--color-ps-dark, #17171c);
        --notice-border: var(--color-ps-border, #c8c8d0);
    }
}

@media (max-width: 480px) {
    .ps-action-notice {
        inset: auto 16px max(16px, env(safe-area-inset-bottom)) 16px;
        width: auto;
    }
}
