/* fs-undo: see CLAUDE.md conventions - theme tokens (--dbn-*), --fs-live only for live / action-needed things. */

/* The grids' undo toast (fs-grid.js): "Deleted: Bib 12" with Undo for 10 s, in #fs-toasts next to FS.toast. */
.fs-undo {
    position: relative;
    display: flex;
    align-items: center;
    gap: 4px;
    width: min(380px, calc(100vw - 32px));
    padding: 8px 8px 10px 14px;
    overflow: hidden;
    border: 1px solid var(--dbn-border);
    border-radius: var(--dbn-radius);
    background: var(--dbn-popup);
    color: var(--dbn-text);
    box-shadow: var(--dbn-shadow, 0 10px 30px rgba(0, 0, 0, .2));
    font-size: .875rem;
    pointer-events: auto;
}
.toast-container > .fs-undo:not(:last-child) { margin-bottom: .5rem; }

.fs-undo-text {
    flex: 1 1 auto;
    min-width: 0;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.fs-undo-button,
.fs-undo-close {
    flex: none;
    min-height: 32px;
    border: 0;
    border-radius: var(--dbn-radius-sm, var(--dbn-radius));
    background: none;
    color: inherit;
}
.fs-undo-button {
    padding: 4px 10px;
    color: var(--dbn-accent);
    font-weight: 600;
}
.fs-undo-close {
    width: 32px;
    padding: 0;
    color: var(--dbn-text-muted);
}
.fs-undo-button:hover:not(:disabled),
.fs-undo-close:hover { background: var(--dbn-hover); }
.fs-undo-button:focus-visible,
.fs-undo-close:focus-visible { outline: 2px solid var(--dbn-accent); outline-offset: 1px; }
.fs-undo-button:disabled { opacity: .55; cursor: default; }

/* The time left: a thin bar running out along the bottom edge; it stops while the pointer or the focus is on the toast. */
.fs-undo-time {
    position: absolute;
    left: 0;
    right: 0;
    bottom: 0;
    height: 3px;
    background: var(--dbn-text-muted);
    opacity: .45;
    transform-origin: left center;
    animation: fs-undo-time var(--fs-undo-duration, 10s) linear forwards;
}
.fs-undo.fs-paused .fs-undo-time { animation-play-state: paused; }
.fs-undo.fs-done .fs-undo-time { display: none; }
@keyframes fs-undo-time { from { transform: scaleX(1); } to { transform: scaleX(0); } }

/* Undone: the toast says so for a moment, without buttons. */
.fs-undo.fs-done { padding-bottom: 8px; }
.fs-undo.fs-done .fs-undo-button { display: none; }

@media (prefers-reduced-motion: reduce) {
    .fs-undo-time { display: none; }
}
