/* ── Undo Toast ── */
.doc-undo-toast {
  position: fixed;
  bottom: 24px;
  left: 50%;
  transform: translateX(-50%) translateY(16px);
  background: rgba(255, 255, 255, 0.82);
  backdrop-filter: blur(16px) saturate(1.6);
  -webkit-backdrop-filter: blur(16px) saturate(1.6);
  color: var(--color-text-primary);
  padding: 6px 6px 6px 20px;
  border-radius: 100px;
  border: 0.5px solid rgba(31, 31, 30, 0.15);
  display: flex;
  align-items: center;
  gap: 12px;
  font-size: var(--font-size-sm);
  font-weight: 600;
  box-shadow:
    0 4px 6px -1px rgba(0, 0, 0, 0.07),
    0 12px 24px -4px rgba(0, 0, 0, 0.12),
    0 0 0 0.5px rgba(0, 0, 0, 0.03);
  z-index: 400;
  opacity: 0;
  pointer-events: none;
  transition:
    transform 0.35s cubic-bezier(0.32, 0.72, 0, 1),
    opacity 0.25s ease;
}

.doc-undo-toast.active {
  transform: translateX(-50%) translateY(0);
  opacity: 1;
  pointer-events: auto;
}

.doc-undo-btn {
  background: transparent;
  border: none;
  color: var(--color-text-primary);
  padding: 7px 14px;
  border-radius: var(--radius-lg);
  font-size: var(--font-size-sm);
  font-weight: 600;
  font-family: var(--font-family);
  cursor: pointer;
  min-height: 34px;
  white-space: nowrap;
  transition: background 0.15s ease;
}

.doc-undo-btn:hover {
  background: rgba(128, 128, 128, 0.09);
}

.doc-undo-btn:active {
  background: rgba(128, 128, 128, 0.14);
}

.doc-undo-btn:focus-visible {
  outline: 2px solid rgba(31, 31, 30, 0.3);
  outline-offset: -2px;
}

.doc-undo-close {
  background: transparent;
  border: none;
  color: var(--color-text-secondary);
  font-size: 1.1rem;
  line-height: 1;
  padding: 6px 8px;
  border-radius: var(--radius-lg);
  cursor: pointer;
  transition: background 0.15s ease, color 0.15s ease;
}

.doc-undo-close:hover {
  background: rgba(128, 128, 128, 0.09);
  color: var(--color-text-primary);
}

.doc-undo-close:focus-visible {
  outline: 2px solid rgba(31, 31, 30, 0.3);
  outline-offset: -2px;
}

[data-theme="dark"] .doc-undo-toast {
  background: rgba(26, 32, 53, 0.78);
  box-shadow:
    0 4px 6px -1px rgba(0, 0, 0, 0.2),
    0 12px 24px -4px rgba(0, 0, 0, 0.35),
    0 0 0 1px rgba(255, 255, 255, 0.04);
}

/* ── Responsive: Undo Toast ── */
@media (max-width: 767px) {
  .doc-undo-toast {
    left: 12px;
    right: 12px;
    transform: translateX(0) translateY(16px);
    width: auto;
    padding: 5px 5px 5px 16px;
    border-radius: var(--radius-lg);
  }

  .doc-undo-toast.active {
    transform: translateX(0) translateY(0);
  }
}
